About broken windows and software gardening ... - Thoughts from The Pragmatic Programmer

2013-02-16 Software-Engineering Books Culture Thoughts

These days I am writing more source code again (mostly Scala) and decided to (re)read a couple of books to refresh some thoughts and ideas and believes that I always had when it comes to writing source code.

One of the books I was (re)reading was Clean Code and there are lots of good ideas in it, e.g. after reading the book 15 years ago I got into the habit of refactoring, whenever I feel the urge to put a comment in the code, which is an indication that the code is not clear/self-documenting enough. The only comments I am writing these days are comments on why the code is doing what it is doing, not what it is doing (that should be apparent from the code itself).

Anyway ...

While I was reading Clean Code one of the Gilt engineers in Dublin recommended to also take a look at the Pragmatic Programmer and I just finished it two weeks ago. The book is more compact than Clean Code. If you have the time, read both. If not, just read the Pragmatic Programmer.

Two thoughts/pictures resonated with me ...

Broken Windows is about fighting Software Entropy and puts a nice picture/story around the concept that you should always check-in the code a little bit cleaner than you found it. Be clean and if you find a broken window (that somebody else broke), fix it! That behavior can be omnipresent in your life. I live in Ireland and do a lot of hill-walking and the rule is whatever you carry up the hill, you will also carry down, but you can take that a step further and pick up cans and bottles that you find on the hill (my habit to pick up litter wherever I find it drives my wife nuts) and leave the hill cleaner than you found it.

Software Gardening puts our ambitions to construct software into perspective. If you construct something (e.g. a bridge) it is kind of static. The idea is that software engineering is more like gardening and less like construction. The software system has a life on its own. It grows. Initially you have an idea how the garden should look like and put the flowers and the bushes and the trees into place, but then over time you need to make sure you also spend some time on pruning and refactoring to keep the garden in shape, because it has a life on its own.

Here is a picture of me looking through a window into my garden.


Hi Ugo, thanks for the pointer ...