Skip to Content

Sandi Metz: Making is Easy, Mending is a Challenge

EP-050 | April 13, 2020 | 47:07 | Last updated: August 7, 2024

Code Quality Refactoring Legacy Code

Sandi Metz

Author & Software Developer, Independent

Author of 'Practical Object-Oriented Design in Ruby' and '99 Bottles of OOP'. A renowned speaker and teacher on object-oriented design and refactoring.

In this episode of the Maintainable Software Podcast, Robby is joined by Sandi Metz, a renowned programmer, author, and speaker known for her expertise in object-oriented programming and maintainable code. Sandi shares her invaluable insights on various aspects of software development, focusing on writing code that stands the test of time.

Episode Highlights

  • Maintaining Readable Code: Sandi emphasizes that the cost of software lies in its readability. She discusses the importance of writing code with good names and gentle organization, making it easier for future developers to understand.
  • Avoiding Clever Code: Sandi warns against writing overly clever code that even the author might not understand later. Instead, she advocates for clear and simple code that conveys the programmer's good intentions to future readers.
  • Documentation and Integration Tests: While Sandi believes in minimal documentation at the object level, she stresses the importance of integration tests and visual aids that show how everything fits together.
  • Common Legacy Code Issues: Sandi identifies common patterns of problematic code in legacy systems, often resulting from neglected complexity and social bargains within teams that lead to unwieldy classes and procedures.
  • Technical Debt vs. Bad Code: She discusses the nuanced difference between technical debt and bad code, emphasizing the need for shared language and understanding between developers and stakeholders.
  • Training and Education: Sandi reflects on the importance of proper training for developers and how educational institutions might better prepare students for the real-world challenges of maintaining existing codebases.
  • Small Pieces, Big Impact: Advocating for the creation of small, manageable pieces of code, Sandi explains how this approach simplifies maintenance and enhances code readability.
  • Refactoring Strategies: Sandi shares strategies for refactoring large classes and objects, often seen in Rails applications, and the benefits of creating service objects and other intermediary classes.
  • Long-Term Framework Viability: Sandi discusses the future of frameworks like Rails, the importance of not being overly reliant on them, and preparing for potential technological shifts.

You'll also hear some thoughts on Ruby and Rails and how Sandi uses the phrase "Lambs to the Slaughter."

Helpful Links

Tune in to this insightful episode and learn from one of the best in the industry about writing maintainable software that your future self will thank you for!

Frequently Asked Questions

What does Sandi Metz say about working with legacy code?

Sandi explains that making new software is relatively easy, but mending existing software is the real challenge. She advocates for incremental improvement through small, safe refactoring steps rather than big rewrites.

How does Sandi Metz approach refactoring?

Sandi recommends following the 'flocking rules' — finding the smallest difference between duplicated code and making incremental changes. She emphasizes that good object-oriented design makes code easier to change over time.

What is Sandi Metz's advice for maintaining software?

Sandi suggests focusing on making code open for extension but closed for modification. She believes in writing code that is easy to understand and change, rather than optimizing for cleverness.

🎧 Listen from Anywhere 🪐

Listen on all the major podcast platforms.

Between the episodes

224 Episodes published since 2019

Stay sharp. Skip the noise.

One email when a new episode drops. That's it.

Joined by engineering leaders at companies you've heard of.