Talks
Speakers
Events
Topics
Search
Sign in
Search
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
search talks for
⏎
Suggest modification to this talk
Title
Description
Zen and the Art of the Controller by Michael Kelly So you’re fresh out of boot camp or just off a month long binge on RoR tutorials/examples and you’re feeling pretty good about MVC and how controllers fit into the whole framework. But projects in the wild are often far more complicated than you’ve been exposed to. In this talk, we’re going to discuss several techniques used by seasoned engineers to build and refactor controllers for features you’ll actually be working on. Help us caption & translate this video! http://amara.org/v/JUpJ/
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
### Zen and the Art of the Controller In this presentation, Michael Kelly, a senior Rails developer, delves into the complexities surrounding Rails controllers, particularly focusing on how to manage and refactor them effectively in professional environments. Despite controllers appearing straightforward, they often become bloated and unwieldy in real-world applications due to rapidly changing requirements and feature creep. #### Key Points Discussed: - **Understanding Controller Complexity**: Kelly emphasizes that junior developers often encounter a simplified view of controllers? focusing mostly on standard CRUD operations like index and show. However, real-world professional controllers can be complex, leading to difficulty in maintenance and development. - **Identifying Bloat Causes**: He points out that controller bloat typically follows actions such as adding AJAX functionality, which can contribute significantly to a rising action count. For instance, imagining a scenario with an Ads Controller that starts with seven actions but balloons to fourteen as more features and requirements continually add complexity. - **Implementing Solutions**: To combat excessive complexity, Kelly recommends breaking down controllers into smaller, more focused components. For example, creating separate controllers for distinct functionalities (like an Ads Preview Controller) can simplify the code and assist with easier debugging. - **Best Practices**: Kelly encourages developers to keep to a RESTful design, clearly defining resources and maintaining healthy boundaries regarding controller responsibilities. Each action should be defined distinctly to avoid clutter and confusion. - **Long-Term Maintainability**: He highlights the importance of making strategic decisions during development, advocating for creating smaller actions and refactoring code sooner rather than later to reduce long-term difficulties. #### Conclusions and Takeaways: - Maintain focus within controllers by ensuring each action corresponds to a specific concept. - Strive for modular controllers to improve clarity and navigability, allowing new developers to onboard easily. - Understand that while it may seem easier to add functions to existing controllers, creating new ones fosters long-term maintainability. - Commit to a rigorous evaluation of project structure as applications evolve, regularly assessing the placement of controllers to adapt to burgeoning requirements. In conclusion, Michael Kelly's talk illustrates the need for thoughtful structuring of Rails controllers to balance ease of use and long-term maintenance, encouraging developers to prioritize clarity and responsibility in their coding practices.
Suggest modifications
Cancel