I’ve been following Bob Martin on Twitter for awhile now; I think he has a lot of good things to say about programming, especially things like Agile and Fitnesse, which I’m interested in. Doesn’t hurt that I tend to agree with a lot of his outlook in general.
This post came across in a tweet today. I haven’t read Clean Code yet (it’s on my list), but the main thrust of the argument being made resonated with me. I think there is a reluctance by many to express themselves strongly, even dogmatically, in discussions about programming (or life in general, for that matter). Relativism rules the day.
I’ve never understood that mindset in a programmer, because there are so many objective, understandable criteria that apply to the discipline. There’s the acid test that other fields lack (or more accurately, deny having): Eventually, code has to run through the brute binary logic of the CPU. More practically, the whole concept of bug fixes contradicts relativism, because by definition a bug is something that isn’t working correctly. Granted, it’s not an universal objective; it’s wrong within a (please let it be well-defined) context. Unexpected or counterintuitive behavior isn’t always a bug (though, IMO, it is a smell that something needs to be improved).
Programmers are always making judgements about whether something is working properly. That’s one reason I’m such a TDD fan: The tests define the standard, and can always be applied against the code to see if it’s still right. Holding to the idea that it’s intolerant or nasty to say something is–gasp!–right or wrong is cognitive dissonance in a programmer.
Actually defending one’s position is key of course. Evidence and reasoning should always be provided. Any developer passing down standards and practices as if speaking ex cathedra is asking for trouble. Even if they have the authority to make things stick, it’s a losing game long-term because it stifles the intellectual curiosity that any professional programmer has. The autocrat is left with a kingdom of drones, because the problem solvers with fertile imaginations (apologies for the metaphor abuse) will have moved on.
I think Josh Bloch was the first programmer I met that embodied this. I didn’t agree with everything he said, especially at first, but he knew what he believed and defended his assertions with logic and examples. This allowed me to test what he said, try it out, and see if it held true in my work universe. Most of the time, it has. To this day, I recommend Effective Java to every Java programmer I meet.
The work I’ve seen from Uncle Bob has helped me become a better programmer and has forced me to think about my own preconceptions about my chosen industry. That’s a good thing.