Your Coding Style Does Matter

Posted by Thomas Gideon on 23 December 2007

I read another piece by Jeff Atwood that I found infuriating this week. This confirms my impression that while Jeff may be a UI or HCI professional of some quality and even a tech geek to some degree, he is no hacker.

First and foremost, I don't necessarily disagree with his main point. Code without a purpose is a waste. However, that purpose may simply be for the enjoyment or education of the author. Regardless, suggesting that the ultimate utility of the code far outstrips all other concerns, including language choice and coding style is dangerously naive. It is not the same thing as suggesting it is the first priority, a point with which I would have gladly agreed.

Programming languages come with their own strengths and weaknesses. Atwood's discussion even touches on this point with regards to Perl. It is easy to learn and code but difficult to clearly and consistently express intention. Maintainability, in my experience flows directly from how easy it is to deduce the original author's intent in a piece of code.

I don't care how useful your software is to an end user, if you cannot fix bugs and add features in a cost effective manner, that will eventually become apparent to your users. Microsoft would be a prime example. The open source database, which I would lay solid money is MySQL, to which Atwood refers through his acquaintance, is another example. Yes, to the vast majority of hackers who just need a simple database that works, MySQL works well enough. To anyone who has everyone read any of its sources, there are much more preferable choices, like PostgreSQL, that are better engineered.

In this instance, with an open source product, the code quality is much more telling as poor quality may chill contributions and patches, on which open source thrives. In the case of Microsoft, a closed source example, you don't need to look far to find stories of annoyances where if all things were equal, those irritations would cause a user to select something else.

Here is where some of Atwood's disingenuousness shows. When Bugzilla was written, it was the only practical open source choice. That is no longer the case. MySQL trades on the practice, for reasons that are unclear to me, of being bundled and most widely supported by a lot of other open source software. I know I have been in situations where I would rather have dropped in PostgreSQL but couldn't because the software I am installing only supports MySQL. I rather suspect MySQL's popularity is similar to what used to happen with Microsoft Access. A developer would use it for small scale development and just keep rolling it out even into situations where it was a poor technology choice.

What all this really suggests is that selection of software is a multivariate exercise for the buyer or user. Language choice and programming style rarely enter into their thought process, I'll concede that. I do not believe this excuses developers from making good choices and exercising solid discipline, as Atwood seems to suggest. I think that it is irresponsible to suggest anything like this. Customers are also paying for reliability, security and many other qualities that derive from the caliber of the engineering, which itself starts with the rigor of clear coding conventions and expressive, intentional sources.