This is review of the 12th chapter from the book-”Clean Code: A Handbook of Agile Software Craftsmanship” by Robert C. Martin.
You don’t design good software. A good design emerges by itself…
This chapter re-iterates Kent Beck’s four rules of simple design
Runs all the tests
Contains no duplication
Expresses the intent of the programmer
Minimizes the number of classes and methods
Having good set of test cases is of utmost importance. Once you have a reliable set of test cases- you can fearlessly bring changes to the application. because you know that you can test what you are changing
Most software erodes by the plain fear of unknown impact of such changes. And once you have test cases- this fear goes away or at least diminishes…
The last rule mentioned is to minimize number of classes and methods. Ina way this is in contrast to SRP which advocates a separate class for every responsibility. But its also essential to keep in mind a necessity to keep number of classes and methods low. Dogmas like- every class to be accompanied with an interface – should be rejected . Have interface whenever needed and maybe often. But a rule saying every class must have an interface is totally unreasonable.
For review of other chapters- please see this post.

Recent Comments