Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf 2016 - Keyword Args — the killer Ruby feature you aren't using by Guyren G. Howe Write clearer code more easily. Write functions that are more composable and flexible. Ruby 2.0's KWArgs feature isn't just an easier way to write functions that take keyword arguments; KWArgs turn Ruby into a lean, mean Hash processing machine. In this talk, you'll learn the details of how to write the next generation of Ruby code. Code that is easier to read, easier to write, more flexible and easier to change, all based on this one simple Ruby feature.
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
In his presentation at RubyConf 2016, Guyren G. Howe discusses the often underutilized feature of keyword arguments (KWArgs) in Ruby, introduced in Ruby 2.0. The main theme of the talk is how utilizing keyword arguments can lead to clearer, more flexible, and maintainable Ruby code. Howe begins his talk by providing context about his experiences as a Ruby developer and outlines the importance of keyword arguments in modern coding practices. He emphasizes several key points throughout his presentation: - **Definition and Functionality**: Howe starts by clarifying what keyword arguments are and explaining their syntax and function in Ruby. He highlights that keyword arguments allow for clearer method declarations, particularly when various types of arguments—such as positional and optional ones—are involved. - **Clarity in Code**: One of the primary advantages of keyword arguments is that they enhance code readability. Howe contrasts traditional argument handling with a cleaner, keyword-based approach. He illustrates this by referencing a complex method within the Ruby standard library that benefits from keyword arguments, showcasing how keywordization can clarify what each argument represents. - **Flexibility**: Keyword arguments provide significant flexibility, allowing developers to make functions more adaptable. Unlike positional arguments, which must be provided in a specific order, keyword arguments can be passed in any order, facilitating easier management of optional parameters. - **Practical Examples**: Howe uses the example of a function call in a Ruby web framework that could become unwieldy with traditional positional arguments. By transitioning to keyword arguments, new optional parameters can be added without disrupting existing calls, thus maintaining clarity throughout the codebase. - **Encouraging Functional Programming**: Howe suggests that adopting keyword arguments aligns with a more functional programming style, where functions are easier to manage and lead to less 'bureaucracy' in coding practices. He encourages developers to consider the implications of using keyword arguments to streamline their code. - **Best Practices**: While advocating for keyword arguments, Howe also addresses potential formatting styles that may initially seem off-putting but aim for clarity. He urges developers to embrace these changes for the long-term benefits in code readability and maintainability. In conclusion, Guyren G. Howe champions the use of keyword arguments as a powerful tool in Ruby that enhances code clarity, flexibility, and functional programming practices. By adopting keyword arguments, developers can refactor their code to be cleaner and more efficient, ultimately improving the overall coding experience and maintainability of their projects.
Suggest modifications
Cancel