Tuesday 4 June 2013

Symbiosis

Well, it has taken me more than expected to write this one. Not because was difficult to find the idea, or put it into words, but mostly because I kept doing other things ... and also because I was a bit lazy. One day I will be able to reliable write once a week (I don't need/want more)

When I was at university I read Extreme Programming Explained by Kent Beck. I was being taught at that time the standard development processes



 (Waterfall, Iterative, ...). What it was advocating was barely touched at University (don't remember then saying anything about testing, or showing the results to the stockholders, or anything similar). It did leave an impression. And was on the back on my mind once I graduated and started to work.

After a few years of working I was in a position to start moving my department into a fully agile environment (we are still in our way to be an agile shop). I introduced unit testing, taught the guys about refactoring (and our code being C# Ctrl R + M is your friend), we will be
 introducing soon acceptance testing, continuous integration and TDD. We have one project being worked under Scrum.

Around the same time that we started adding unit testing I read Clean Code by Unce Bob et al. This book, same as Extreme Programming Explained, left some big impression (although this time I was able to start applying its concept as soon as I put the book down). Power through simplicity. I had the experience to see that big methods are problematic.

Let's add to the mix SOLID, YAGNI, DRY, ..., stir and:

Progressively I realized that the old adagio was still valid: "The whole is greater than the sum of its parts". Each part supports at least one other, in some kind of circular graph. Clean code facilitates unit testing, TDD leads to clean code, unit testing facilitates refactoring, refactoring allows you to create clean code, working under SOLID makes testing simpler, clean code facilitates SOLID, refactoring facilitates DRY

There is a symbiosis formed out of the parts, one feeding from other, and being a feeder itself.

And it comes back to what Kent Beck said on his book (paraphrasing): If each part is useful, using all parts must be good.

Now I look at my previous code, things that I have written in the last few years, and I see so many places where it can be improved, where it can be made easier to read, to understand, to modify, ...

Before I though that programming was most probably a craft. Now I strongly believe so. You need to learn the tools of the trade, where those tools are not the software applications that you use, but the ideas, the knowledge, all the thinking that has done before you. And then you have to hone your skills based on them, choose what is suitable or not, adap it to your (or your shop/department) so the software that you write stands against any adversity that befalls it.