2 Iterate to achieve good design
This chapter covers
- An iterative development strategy to achieve a well-designed application
- Backtracking to recover from bad design decisions
- Design principles to improve code
The development path to a well-designed application is almost never straight and narrow. As described in chapter 1, we should not have marathon coding sessions and then count on a magical Big Bang finish.
A much more rewarding development strategy takes an iterative approach. Each iteration builds on the accomplishments of the previous one. Such a strategy is more likely to result in a successful well-designed application.
The example application in this chapter demonstrates the iterative development strategy, and it includes backtracking over a bad design decision. In addition, the chapter also deals with change and complexity, the major challenges to good design. It introduces several key design principles, which will appear repeatedly in subsequent chapters that will introduce additional design principles.
2.1 Good application design requires an iterative process
By some accounts, Wolfgang Amadeus Mozart was such a musical genius that he could compose an entire symphony in his head and then write it down with few, if any, edits. Hardly any of us is a programming Mozart who can develop well-designed applications in our heads and then write the code perfectly all at once.