Good code is like good coffee
The more good coffee I drink the more fussy I am about the taste. When I look back at the coffees I find myself being critical of my old preference. I’m on a quest for good coffee and I’ve learned just how much bad coffee people drink.
Recently I’ve been catching up with other coffee lovers to compare notes and I’ve been surprised to find how different some of our tastes are. So if every coffee-lover has a different favourite coffee with it’s own character and flavours does the development community has the same dynamic?
I place a very high priority on code quality, I feel that’s part of being a responsible developer. Judging what is the correct solution, semantic naming and logical structures are often a matter of personal preference. This brings up a challenge: How to distinguish between code which isn’t my preferred style but has an internally viable quality and code which is just bad?
The question I ask myself in this situation is simple – ‘is there a problem with the dominant coding style in this application? Does it cause us pain?’ if the answer is yes then it needs addressing and my preferred style can be considered alongside others as a solution. If the answer’s no it’s time to remind myself that it doesn’t enhance the quality of the codebase as a whole for me to impress my personal preference for the sake of it – it’s better to be consistant. If I’m not sure then I’ll give myself a few weeks to figure it out – after a few weeks I’ve either forgotten there was ever a problem or it’s driving me insane.
When coding consistently with an existing codebase you’ve got a perfect opportunity to see the pros and cons of that style – you never know, you might fall in love with it. By sampling coffees outside my normal preference I’ve enjoyed what I thought I’d dislike and disliked what I thought I’d enjoy. As I look back at how my tastes have changed with code style and coffee over the years I’m reminded to keep an open mind to other people’s perspective of ‘good quality’.