In my organization, a handful of the teammates have begun to read (and report on) Bob Martin’s book “Clean Code”. One of these gentlemen has even gone as far as sending some of his learnings out in a daily email as a “Clean Code Tip”. Right from the start, email replies started asking one rather obvious question, “Why is Uncle Bob so angry!?” He uses phrases like, “There is hardly anything more abominable”, when discussing Selector Arguments, or “Commented-out code is an abomination”. Really Uncle Bob? Hardly anything? Abomination? You can see how this might raise the ire of an unsuspecting software developer, and human for that matter, who may stumble into this “Tip”. Well, I defended Uncle Bob and responded with the following theory. I wonder if I got close? …
Rather than angry, I think he seems Dogmatic…and by his own admission, he is.
I think his purpose is pretty clear, but moreover, he knows what DOESNT work with the software development community. Namely, an absence of strongly held principles. I think there is such weak agreement and leadership in our chosen field that anyone who proposes consistency will be looked at as angry.
It has always struck me that the examples we talk about seem so nuanced and granular. It’s easy to dismiss the example as “nit-picking”. I don’t think we should be so quick to dismiss.
So why do these examples seem so easy nit-picky? I think it’s because that’s the nature of writing code. Some things can stand the developers use of “creative license”. After all, we are creating something from NOTHING. It ALL comes from our mind. Therefore, it is an interpretation. It is indeed art.
That said, we have to force ourselves to be mindful of HOW it is done (especially in a business context). To allow our designs and implementations to emerge requires some level of consistency that ultimately makes the work easier to bend and shape. The less disciplined you are, the harder it is to react to incorrect interpretations (which happen by the hour).
If you like sports analogies, its similar to my basketball coaches when I was young telling me to keep my elbow IN when I shoot free throws. They didn’t “suggest it”. They would smack my elbow as they walked by if I wasn’t doing it! Why? Because they knew the rest of the shots I would take on the floor are affected by backspin, arch, consistency, and a good, high release. If I did it inconsistently at the free throw line, it changes my ability to “create” shots on the floor. It changes my ability to react to a fast paced environment like a basketball game.
So were my coaches being nit-picky? Or did they help teach the discipline that would allow me to create more in the long run?