;)
james.rambleOn(true);
Let's Goto! December 14, 2011 6:09am
I've written code for a lot of companies. At last count it was well over thirty. Believe it or not, only a few of those companies used and enforced formal coding standards and best practices. Of those, all are now defunct. The point? A standard does not make a good product.

The curious thing is that at every single one of these companies there was at least one developer, usually some young buck fresh out of college, with genuine nerd rage over the code base or some other developer's code. All the seasoned devs - and that doesn't mean old so much as very experienced - would joke around about it, but weren't all that concerned. That's because a good coder is more interested in the content than the appearance. If the code works, and works well, I couldn't care less if all the equal signs line up. Readability is all well and good, but I'd much rather a developer was thinking about the algorithm than where to put a curly brace. Subjectivity has no place in code. Which brings me to the best practices portion of the phrase.

Let's analyze the term for a second: best practices. By definition, a "best" practice is subjective. In programming there's usually more than ten ways to do something. Which one is "best" depends on the context, therefore there can be no true best practice. To rule in advance that a particular way of handling a given problem is the only acceptable method can severely hinder future solutions.

Let's use my favorite example, our friend the goto statement. Easily the most hated artifact in the programming world. But why? Many will tell you because it causes spaghetti code. I would argue that it is the developer who cooked those noodles. Besides, millions of lines of spaghetti code is written on a daily basis using seemingly best practices of object oriented programming. Goto, like OOP, has its purpose, and also like OOP, can be easily abused. To blacklist any given statement, function, or design pattern in coding is akin to stripping a carpenter of his hammer for fear he might break something.