Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
By Mark Menard To paraphrase Mark Twain, "I didn't have time to write some small classes, so I wrote a BIG ONE instead." Now what do you do? Refactor! In this talk we'll refactor some large classes into a series of smaller classes. We'll learn techniques to identify buried abstractions, what to extract, what to leave behind, and why delegation, composition and dependency injection are key to writing small things that are easier to test. Help us caption & translate this video! http://amara.org/v/FG16/
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 "Small Code" by Mark Menard, presented at Ruby on Ales 2014, emphasizes the importance of writing small, composable code to enhance software design and maintainability. Menard discusses the problems of large classes and methods that encapsulate complex business logic, leading to code that is difficult to change and understand. He introduces the idea that small code is not merely defined by line count but rather by its organization and design discipline. Key points include: - The distinction between 'small' and 'well-designed' code; it's about organization rather than the physical size. - The necessity of small methods, which serve as a foundation for achieving small code. Chaos in large methods indicates the need for refactoring. - The role of indirection, as expressed in a quote by Dennis Ritchie, highlights how adding methods improves flexibility and separation of concerns. - Emphasizing small classes promotes reusability and composability. More classes often lead to better-designed systems. - The need for a robust design to cope with changing software requirements over time; small code facilitates easier adjustments. - The significance of managing dependencies in object-oriented design, which allows for context independence in testing and reuse. - Techniques for refactoring such as 'extract method' and 'extract class' are essential for breaking down larger code units into understandable fragments. Menard utilizes a command line options parser as a practical example to demonstrate how to refactor a complex class structure into smaller, manageable components. He notes the challenges of creating exemplified code that is both simple for demonstration and practical for real-world application. The session wraps up with the assertion that well-designed software can live longer and thrive through the use of short methods, citing Robert C. Martin's influence on this concept. Overall, the goals presented are to develop small, understandable units of code that can easily adapt to changes, thus promoting better software practices.
Suggest modifications
Cancel