I hate the expression “best practice”, it’s so, so often used by someone to justify the application of cargo cult without actually understanding why.
– “Hey why are you having a try-catch there, it seems like it’s just gonna break our stack trace and we don’t even graciously recover from it” - it’s best practice
– “Hey why are you using model/view/controller folders?” - it’s best practice
– “Why are you building microservices?” - best practice.
– “Do we really need machine learning?” - BEST. PRACTICE. Also let me tell you about blockchain.
To begin with, if these practices are the best, there’s no reason why to search for better practices. They’re already the best! Why think? Then there’s the fact that most of the time I hear the expression, it’s used to either avoid a debate, or remain so vague as to avoid having to be factual. People integrate how to do something in a context, call that best practice, and will cast anything deviating from that as “not best practice”. Nevermind that this “best practice” is not applicable in that context, has since then been replaced by a better way of doing things, or has never been a best practice to begin with. You’ll also find those who apply “best-practices”, fail at implementation, then claim the practice is not best, and actually actively bad (scrum, you’re giving agile a bad rep1, and just wait a few years to see if microservices are still a “best practice”).
I found that most of the time, the expression could be replaced by “tradition”, “pattern”, or “the way I’ve seen others do”.
- If it’s a tradition, standard, or convention, and most people agree to it, fine. Might help with readability and familiarity ; and help people navigate through a code base (or whatever the best practice is about - boat knots, how you grease your mountain bike front fork, etc.). Call it a convention, stop pretending it’s the best, it’s just how we (or you) decided to do things.
- If it’s a pattern, fine, but be ready to tell me why it’s applicable and helpful in our context. And stop calling it best, call it by its name.
- If you can’t explain why you’re doing something, and you’re just doing what you’ve been seeing others do, maybe rethink it and educate yourself on the topic. And do NOT call it a best practice because, obviously, you don’t know if it really is the best. Call it cargo cult.
And even if you do know, the expression by itself is not self-sufficient. People on the receiving end will have to ingest that “it’s the best” without understanding the reason why, without a name to refer to, and society as a whole will have lost an opportunity of advancing its enlightenment. You don’t need to re-explain everything everytime, but at least don’t be lazy, and refer to the standard or the pattern that you’re referring to. You might even have to reconsider whether what you are suggesting is effectively better, or if it’s just that you’re doing things differently, and who knows: maybe you can even learn something in the process!
Look, I get it: sometimes we need to establish a basis for how we should be doing things. We don’t want to reopen the debate on how we structure code for each code review, so instead, it’s useful to have shorthands. But then stop lying: they’re not best-practices, they’re conventions that (hopefully) we agreed on. When you want to specifically point out that maybe the code calculating taxes should not be referencing MongoDb, be specific: say it’s transgressing the Dependency Inversion Principle, or something savant like that ; then if the person either doesn’t know or agree, you can explain and have a debate. But if you’re saying “it’s not best practice”, there’s no discussion, no education: it’s not the best, that’s it.
So yeah, throwing a bit the baby with the bath water on that one, but I actively hate that expression, and hopefully now you can see why.