This is an excerpt from The Art of Agile Development, Second Edition. Visit the Second Edition home page for additional excerpts and more!
This excerpt is copyright 2007, 2021 by James Shore and Shane Warden. Although you are welcome to share this link, do not distribute or republish the content without James Shore’s express written permission.
Our code is easy to modify and maintain.
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
Antoine de Saint-Exupéry, author of The Little Prince
- Reflective Design
- Incremental Design
When writing code, Agile programmers often stop to ask themselves, “What’s the simplest thing that could possibly work?” They seem to be obsessed with simplicity. Rather than anticipating changes and providing extensibility hooks and plug-in points, they create a simple design that anticipates as little as possible, as cleanly as possible. Counterintuitively, this results in designs that are ready for any change, anticipated or not. It combines with reflective design and incremental design to allow your design to evolve in any direction.
When, not if, I need to change this decision, how hard will it be?
Simple doesn’t mean simplistic. Don’t make boneheaded design decisions in the name of reducing lines of code. A simple design is clean and elegant, not something you throw together with the least thought possible. Whenever I make a design decision, I always ask myself this question: “When, not if, I need to change this decision, how hard will it be?”
The following techniques will help you keep your code simple and change costs low.
...to continue reading, buy the book!
In this Section
- Simple Design
- Key Idea: Simplicity
- YAGNI: You Aren’t Gonna Need It
- Once and Only Once
- Coupling and Cohesion
- Third-Party Components
- Fail Fast
- Self-Documenting Code
- Published Interfaces
- Performance Optimization
- Alternatives and Experiments
- Further Reading