Leo's Technical Blog

Best Practices vs. Common Sense



Leo Soto


Best Practices vs. Common Sense

Posted by Leo Soto on .


Best Practices vs. Common Sense

Posted by Leo Soto on .

Best practices are valuable knowledge. Unfortunately, in my experience, they have a tendency to turn into valuable gospel. And even if in the short term that transformation doesn't hurt, it will hurt.

Best Practices are (part of) little processes. And you may already know what I think about processes. Short version: they are not more relevant than people and tools. But this time I will focus on this small pieces of “wisdom”

The involution of a best practice into a Best Practice

Here comes the history about how, in my experience, best practices can go wrong. Probably you already know it. Feel free to skip to the "Common Sense" heading ;-).

Originally, best practices are very good ideas. Good solutions to real problems. Not necessarily the best or single possible solution, mind you, just one good enough. You know, typically the effort needed to find the best solution from a pool of good ones is so costly that it doesn't make sense. You just pick one, cut the bikeshedding and move on.

Almost. Before moving on you make sure that, for consistency, when facing the same problem again you solve it in the same way. So you document and spread out your new best practice. And I don't have any single problem with them. My problem is with Best Practices, not with best practices.

Best Practices (with capitals) are born when people aren't able to get the reason behind the best practice. Or don't care about it. Or someone else doesn't want to explain himself. Hence, the practice is imposed.

Usurprisingly, people who had the practice imposed on themselves do, in turn, impose it to other people. The gospel is propagated, and sooner or later you end up with a Best Practice which nobody can make real sense of (in case someone really cares!). Heroic “reverse engineering” efforts some time gives an approximate enough picture of the original best practice, but those cases seem to be rare.

Other than the sadness of people filling their mouths about how to follow a Best Practice without knowing why it is valuable (beyond "hey it's what all the other monkeys, err, people do" or some poor attempts at the aforementioned reverse engineering effort), flexibility and agility are instantaneously lost.

Finally, when the good original best practice stops being actually good (for example because the scenario or the problem itself has changed), nobody will notice. Nobody will look at the alternative good solutions (some of them may still be good after the changes of problem or scenario) nor find new solutions. Because, what can be possibly going wrong, if everybody is following the Best Practice?

An example

Now, all of the above sounds quite reasonable, but abstract. If your experience radically differs from mine, it may not resound with you (also, I automatically envy you). It may be a nice theory, but without seeing it on practice, it's worth almost nothing. So here is a trivial example (which actually, is responsible for making me think on this whole post):

“...it should be immediately obvious to anyone who works on even medium sized projects that having many types defined in the same file is a very bad thing. The core of the issue is that it makes group collaboration quite difficult”

Why OO may not suck, or, Take a ride on the Falsus Omnibus

The best practice behind this was indeed a good idea when VCS tools weren't much advanced. But the Best Practice of "you shall never have more than one type defined on the same file" is crap as general advice.

Believe me: I'm not picking on the author or on his article here. It's just one example supporting my point. A good one in my opinion, considering that it is buried inside an article/blog which heavily suggest that the author is far from being clueless.

Best Practices may be more insidious than we think.

Common sense

OK, this post turned out to be more long than what I thought. So I'll try to be brief.

Common sense is the underrated tool which let us avoid the Best Practice pitfall. It seems to me than in the current world, in which the vast amount of knowledge available is a serious problem, conventional wisdom press us to turn off common sense and just assume that things like Best Practices are obviously right. Just obey them even if they don't make sense.

It's like as we decided that common sense was something dangerous and unstable. You know, too human. T-800s are known to be more reliable but unfortunately are still unavailable. But I digress.

Sure, there are lot of stuff in which I'm a complete ignorant. In such matters, I'm unable to evaluate if some practice or procedure makes sense or not. Thus, I trust people who know better than me. I sincerely hope to never have any comment with respect to a lawyer's best practice, for example.

On the other hand, on matters which I know about (and specially on matters my work is based), maybe I don't expect to be as brilliant as the people which is creating wonderful new solutions. But expect to understand such solutions in order to effectively use them (and only then perhaps, someday, be in position to come up with my own genuinely new solution to something).

Bottom line: I think that on the stuff we know about, we should, from time to time, stop and think if the ways we are doing things makes sense. I they don't, go ahead and challenge them. Worst case? You're wrong (i.e, your understanding was incorrect), but then you will learn really why you are doing things the way you are.