Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021)

✨ What is this post about: As a part of my professional growth, I make time to watch conference talks on Ruby, Rails, JS, React, tech writing, and tech trivia. Previously, I’d just watch them but now I will take and publish notes for future reference. …

What is this post about: As a part of my professional growth, I make time to watch conference talks on Ruby, Rails, JS, React, tech writing, and tech trivia. Previously, I’d just watch them but now I will take and publish notes for future reference. This talk was a part of RailsConf 2021 that I’m participating in at the time of writing.

Talk: ‘Implicit to Explicit: Decoding Ruby’s Magical Syntax’ by Justin Gordon

One-paragraph summary: Ruby’s implicitness makes it great for readability and DSLs. But that also gives Ruby a “magical” syntax compared to JavaScript. In this talk, let’s convert the implicit to explicit in some familiar Rails code. What was “magic” will become simple, understandable code.

Impression: I feel this talk was much more about pry and I am blown away by Justin’s ? ~/.pryrc ? (see below ) and the ease it introduces into debugging ? I loved this talk, and Justin’s way of calm and kind explaining complex concepts.



Table of contents:



Notes

  • DSL: Domain-Specific Language
  • Rails leverages Ruby’s implicitness:
    • self
    • variable declarations
    • parentheses
    • much more
  • Can we learn to read Ruby code like the Ruby interpreter?
    • ideally, you should understand the code, not just copy-paste
  • ? ? ? OMG Justin’s pry demo is a must-watch! I need to re-watch it and code along ? ? ?



JS vs Ruby

  • JS is very explicit:
    • you need the parentheses for function invocations;
    • this is rarely implicit;
    • explicit return in standard functions;
  • Ruby is often implicit:
    • parentheses are optional and so zero arg method calls are the same as object values (user.first can be a method invocation or just a call for the attribute);
    • self can be implicit or explicit (it’s explicit for writer methods because otherwise, Ruby’s trying to declare a new local var)
    • implicit returns;



Read more


Print Share Comment Cite Upload Translate
APA
Sylwia Vargas | Sciencx (2024-04-18T16:35:59+00:00) » Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021). Retrieved from https://www.scien.cx/2021/04/14/talk-notes-implicit-to-explicit-decoding-rubys-magical-syntax-railsconf-2021/.
MLA
" » Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021)." Sylwia Vargas | Sciencx - Wednesday April 14, 2021, https://www.scien.cx/2021/04/14/talk-notes-implicit-to-explicit-decoding-rubys-magical-syntax-railsconf-2021/
HARVARD
Sylwia Vargas | Sciencx Wednesday April 14, 2021 » Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021)., viewed 2024-04-18T16:35:59+00:00,<https://www.scien.cx/2021/04/14/talk-notes-implicit-to-explicit-decoding-rubys-magical-syntax-railsconf-2021/>
VANCOUVER
Sylwia Vargas | Sciencx - » Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021). [Internet]. [Accessed 2024-04-18T16:35:59+00:00]. Available from: https://www.scien.cx/2021/04/14/talk-notes-implicit-to-explicit-decoding-rubys-magical-syntax-railsconf-2021/
CHICAGO
" » Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021)." Sylwia Vargas | Sciencx - Accessed 2024-04-18T16:35:59+00:00. https://www.scien.cx/2021/04/14/talk-notes-implicit-to-explicit-decoding-rubys-magical-syntax-railsconf-2021/
IEEE
" » Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021)." Sylwia Vargas | Sciencx [Online]. Available: https://www.scien.cx/2021/04/14/talk-notes-implicit-to-explicit-decoding-rubys-magical-syntax-railsconf-2021/. [Accessed: 2024-04-18T16:35:59+00:00]
rf:citation
» Talk Notes: “Implicit to Explicit: Decoding Ruby’s Magical Syntax” (RailsConf 2021) | Sylwia Vargas | Sciencx | https://www.scien.cx/2021/04/14/talk-notes-implicit-to-explicit-decoding-rubys-magical-syntax-railsconf-2021/ | 2024-04-18T16:35:59+00:00
https://github.com/addpipe/simple-recorderjs-demo