Ruby Video
Talks
Speakers
Events
Topics
Leaderboard
Sign in
Talks
Speakers
Events
Topics
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Get a Whiff of This by Sandi Metz Most code is a mess. Most new requirements change existing code. Ergo, much our work involves altering imperfect code. That's the bad news. The good news is that every big mess consists of many small ones. Certain small problems occur so frequently that they've been given names, and are collectively known as "Code Smells". This talk shows how to take a pile of perplexing code, identify the "smells", and surgically apply the curative refactorings. It breaks a messy problem into clear-cut pieces, and proves that you can fix anything without being forced to understand everything. Help us caption & translate this video! http://amara.org/v/JkoP/
Date
Summary
Markdown supported
### Introduction The video titled *Get a Whiff of This* features Sandi Metz at RailsConf 2016, focusing on the important topic of code smells in software development. Metz discusses how many messy codebases can be dissected into identifiable components, termed "code smells," which highlight potential issues in code design without necessarily indicating that the code is entirely flawed. ### Key Points - **Definition of Code Smells**: - The term "code smells" was coined by Kent Beck to categorize common problems found in code. They indicate that something may be wrong rather than confirming a fault. - **Categorization of Code Smells**: - Metz organizes code smells into several categories: - **Blowers**: These include `Long Method`, `Large Class`, and others contributing to bloated code. - **Tool Abusers**: This group includes misuses of object-oriented programming features, like `Switch Statements` and `Temporary Fields`. - **Change Difficulties**: Problems such as `Divergent Change` and `Shotgun Surgery` fall into this category, making code difficult to modify. - **Couplers**: Items like `Feature Envy` and `Inappropriate Intimacy` create tight dependencies between objects. - **Refactoring as a Solution**: - Metz emphasizes that just as code smells have names and specific meanings, refactorings do too, complete with guidelines. These are practical steps one can take to improve the code quality and rectify identified smells. - **Practical Examples**: - Metz illustrates the transformation of messy code through real examples. For instance, a `Data Clump` problem can be ameliorated by using the `Extract Class` refactoring technique, making it easier to manage and clean. - Another illustration includes handling message chains to enhance flexibility and reduce complexity in testing through better object collaboration. - **Importance of Learning Code Smells**: - Understanding code smells is crucial for software developers. Metz suggests that recognizing these indicators can help one produce cleaner, more maintainable code, facilitating easier refactoring and adjustments as requirements evolve. ### Conclusion The video concludes with a call for attendees to educate themselves on the concept of code smells and the associated refactorings. Metz shares her excitement about progressing skills in coding, suggesting that identifying and utilizing these concepts can help mitigate the chaos in complex programming environments. By reflecting on past coding experiences, developers can appreciate how they grow and improve over time, thereby cultivating healthier coding practices going forward.
Suggest modifications
Cancel