Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Ruby's long had leftward assignment (x = 3) and recently got rightward assignment (3 = or greater x). The problem here is obvious: we need a vertical assignment operator. In a complete abdication of good taste and common sense, this talk will walk through correcting this heinous oversight. We'll abuse otherwise-respectable metaprogramming tools like Ripper and TracePoint to add a fully functional vequals operator. While this talk is almost 100% bad-ideas-by-volume, you'll learn a few tricks that you can use in your day-to-day work (or at least to terrify your co-workers).
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
The video titled "Vertical Assignment in Ruby" by Kevin Kuchta at RubyConf 2021 explores the concept of vertical assignment in Ruby, a feature that has not yet been included in the language despite the existence of leftward and recently added rightward assignment. During this talk, Kuchta humorously argues for the need for a vertical assignment operator, dubbed 'vequals', and demonstrates a metaprogramming approach to implement it using Ruby's tools like TracePoint and Ripper. Key points discussed in the video include: - **Overview of Assignment in Ruby**: Ruby originally supported leftward assignment and has introduced rightward assignment. However, the absence of vertical assignment was identified as a significant oversight. - **Introducing the 'vequals' operator**: The speaker humorously proposes the need for 'vertical assignment' and starts experimenting with various ways to create this operator. - **Using Ruby's Metaprogramming Tools**: Kuchta showcases how to utilize Ruby's metaprogramming features, such as defining methods with unusual Unicode characters to act as operators, thereby pushing the boundaries of typical coding practices. - **TracePoint for Dynamic Behavior**: He explains the use of TracePoint to run code on every line of Ruby code executed, allowing for actions just before any line is evaluated. This was key for implementing the vequals operator functionality. - **Implementation Details**: Through a series of coding examples, he elaborates on how to dynamically define variables and how to interpret lines of code effectively using the Ripper tool to parse Ruby. The process involves emulating a 'just-in-time' variable declaration that automatically assigns values to variables found in the code. - **Hilarious Outcomes and Risks**: The speaker emphasizes the inherent risks and potential confusion resulting from such unconventional programming techniques, targeted mostly for fun rather than production use. - **Encouragement to Experiment**: The conclusion of the talk encourages developers to explore Ruby's flexibility and try unconventional methods to learn more deeply about the language. Rather than producing practical code for everyday use, the talk advocates for creativity in coding as a valuable habit. Overall, Kevin Kuchta's presentation is a humorous yet insightful exploration of an outlandish idea to enhance Ruby's assignment capabilities while also illuminating the power of the language's metaprogramming tools. The light-hearted tone coupled with technical depth makes the topic engaging.
Suggest modifications
Cancel