Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Writing small classes is hard. You know you should, but how? It's so much easier to write a large class. In this talk we'll build up a set of small classes starting from nothing using a set of directed refactorings applied as we build, all while keeping our tests green. We'll identify abstractions yearning to be free of their big class cages. In the process we'll also see how basic patterns such as composition, delegation and dependency inversion emerge from using small objects. Mark Menard is president of Enable Labs, a consulting firm, in Troy, NY specializing in large scale web and mobile app dev. Mark talks about Ruby and coding at conferences and user groups. Mark also gets his hands dirty doing construction work from time-to-time, and is a happy husband and father. Help us caption & translate this video! http://amara.org/v/FGZe/
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 titled "Writing Small Code" features Mark Menard discussing the challenge of creating smaller, more manageable code in programming, particularly within the Ruby language. He emphasizes the importance of writing small classes and methods by using good design and iterative refinement. Key points discussed include: - **The Problem with Large Classes**: Many developers encounter classes filled with complex code that are daunting to modify, leading to duplicated logic and poor understanding. - **Defining Small Code**: Menard clarifies that small code isn't merely about the number of lines but rather how code is structured and organized. He underscores that small, well-designed code enables better systems composed of understandable parts. - **Incremental Improvement**: Writing small code is an iterative process that often requires refactoring to improve design over time. He advocates for maintaining 'green' tests throughout this process to ensure code reliability. - **Importance of Abstractions**: Menard introduces the concept of abstractions as crucial for decomposing large methods and classes into smaller, re-usable components, allowing for easier changes in future requirements. - **Good Design Principles**: Emphasizes principles such as separation of concerns, single responsibility, and reducing conditional logic to enhance readability and maintainability. - **Refactoring Tools**: He presents practical techniques like extract method and extract class to simplify complex methods and improve organization. - **Illustrative Example**: Menard walks through a simple example of creating a command line options parser, demonstrating the evolution from a monolithic class structure into simplified, cohesive classes while handling multiple option types (boolean, string, and integer). - **Dynamic Programming**: He discusses leveraging Ruby's dynamic features to efficiently manage those classes without introducing unnecessary complexity. In conclusion, Menard reinforces that the key to sustainable code is to produce small, comprehensible units that remain flexible for future modifications. By continually refining and refactoring with an eye towards abstraction and cohesive design, developers can create software that not only meets current requirements but also adapts gracefully to future needs. He encourages participants to engage in discussions about coding practices as part of the RailsConf experience.
Suggest modifications
Cancel