Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
By Justin Gordon Let's take some tangled code and untangle it together! We'll improve some model, controller and view code by applying view concerns, helpers, Draper decorators, presenters, and service objects. In doing so, you'll better understand where and when to use these techniques to make your code DRY'er, simpler, and easier to test. As a bonus, you'll also see how RubyMine with VIM bindings boosts refactoring productivity. Justin, aka @railsonmaui, is freelance Rails programmer and the technical evangelist for RubyMine. Passionately writing software since 1985, and focusing on Rails since 2011, he has a popular technical blog at http://www.railsonmaui.com. Degrees include a BA, Harvard and a MBA, UC Berkeley. Help us caption & translate this video! http://amara.org/v/FG1e/
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 this video titled "Concerns, Decorators, Presenters, Service Objects, Helpers, Help Me Decide!" presented by Justin Gordon at RailsConf 2014, the speaker discusses methods for refining and optimizing code in Ruby on Rails applications. The goal is to help developers understand how to make their code more maintainable, DRY (Don't Repeat Yourself), and easier to test by applying various design patterns and coding practices. **Key Points Discussed:** - **Understanding the Problem:** Justin starts by likening tangled code in Rails projects to a 'ball of mud,' illustrating how unclean code accumulates over time due to poor organization. He emphasizes the importance of understanding where to add new lines of code meaningfully. - **Techniques and Patterns:** The core of the talk revolves around several key patterns including: - *Concerns:* Used for extracting related behavior from classes to keep models cleaner and focused on a single responsibility. - *Draper Decorators:* These are designed to handle view-specific logic that would otherwise bloat models, allowing for the separation of concerns between business logic and presentation. - *Presenters:* These help manage instance variables in views, making them cleaner and providing better organization of data for the view layer without cluttering controllers. - *Service Objects:* Although initially included in the talk, Justin ultimately concluded that service objects might not be necessary in many cases, advocating for a clearer understanding of where to place logic in Rails, favoring models over standalone service objects. - **Code Examples:** Throughout the presentation, Justin provides live coding examples to demonstrate how to apply these techniques effectively. He refers to specific patterns such as the concerns pattern and the use of the Draper gem to create decorators that simplify view logic. - **Refactoring Philosophy:** A significant takeaway is the ethos of using Rails effectively and knowing when to apply certain patterns versus simply avoiding over-engineering solutions. Justin shares his learning experiences from interaction with other developers and emphasizes that sometimes cleaner solutions can be achieved without creating new patterns unnecessarily. **Conclusion:** The main takeaway from this talk is the importance of maintaining clarity and simplicity in Rails applications. Justin encourages developers to leverage Rails' built-in features properly, understand the frameworkâs capabilities, and focus on making their code simpler and more effective, rather than complicating it with unnecessary abstractions.
Suggest modifications
Cancel