4 ms·
> Good code also adheres to established best practices, [...] Controversial opinion, but in my experience so far people usually say "this is best practice" as
by quectophoton 3y ago
> Good code also adheres to established best practices, [...]
Controversial opinion, but in my experience so far people usually say "this is best practice" as a way to avoid thinking, or to masquerade personal preferences. Not always, but more often than not.
As soon as you ask "why is it a best practice?", "what are the consequences of not following this best practice?", "since 'best' implies there's a 'not-best', what is an example of the 'not-best practice' that this wants us to avoid doing?".
The answer is usually something vague and handwavy like "because it's more scalable", but if you challenge that by saying "what do you mean with 'scalable'? can you give an example?", you usually won't get an answer.
Doing stuff without understanding the reason, that's cargo cult.
To be clear, I have nothing against people saying "I understand the code better like this"; it's subjective but honest, and it doesn't try to pass a subjective argument as if it were an objective truth. What I dislike is people saying "this is best practice" like an absolute truth that must be blindly followed and never challenged, without even considering the circumstances of the current project.
Please spare me from turning a simple HTTP CRUD of 4 endpoints into an overkill Icosahedronal Architecture with a reason like "when we need to write an v2 this will make it easier without needing a rewrite!"; because I know that when the time comes for an v2 you'll rewrite from scratch anyway because then you'll want to use the new and better(tm) Perpendicular Riemann Zeta Architecture.
- utresk 3y agoI understand the spirit of your comment here, but in my area of experience, security, there are certainly objective “best practices”. There is almost always pushback on security considerations, and partly because those methods quite often change and improve with time. The term then becomes a blanket phrase that captures the constantly evolving landscape and necessity of accepting those new changes. You’re right that it is becoming over used. Like most abridged language, once your favorite becomes popular a new way to express the same underlying idea usually comes along.
- quectophoton 3y agoOh yeah, no doubt there. If a nobody like me writes a random blog post saying my custom way of doing ThisSecuritySensitiveThing is the best, at the next microsecond I'll have half the world linking me to like 20 different papers and 5 real incidents proving why I'm wrong. And I wouldn't be able to wiggle my way out of that criticism with responses like "but it works for us".