by goto11 · 5y ago · 0 comments
Only reject a "best practice" if you understand why it was there in the first place.
Maybe I'm just being immature, though!
Otherwise some good points in the article. I'd say a good sign of maturity is that you understand you job isn't to write code, your job is solving problems for the business.
The solution is to ignore these "my thing is objectively better than yours in 100% of cases" debates - choose the pattern/design/paradigm/thing with the least compromises and do something productive :-)
For the juniors on my team, the next question I always ask after the answer "it's best practice" is always "why is it best practice?"
It's fundamentally important to understand why something is best practice, so that you know when it is not the best course of action.
Usually when people are focused on working and working together fast, the converge on pragmatic efficient solutions.
Of course 'together' is subtle here ..
The reason? It’s a small, rapidly-built prototype hooking two poorly documented systems together while the company makes daily adjustments to the manual process I’m automating.
Everything is in flux because we have just started working with a new vendor that will significantly improve our logistics. All of the chaos is deliberately considered and discussed weekly. (I’m in all of those discussions.)
It’s really beautiful to see this all come together. Once we’ve figured out how this will work, it’s time to firm up the internals and nail it down with tests.
Even if that day never comes, the application has extensive logging (~75% of the application code is devoted to highly detailed logs) and production errors will quickly be detected, with enough information to manually fix a bad import or export.
Once edge cases do come up, you can bet I’ll write tests to prevent regressions.
It's actually the more senior devs who go beyond and investigate how things could be done better.
I agree that certain standardisation of practices need to exist. I would rather work with someone who calls even imperfect practices as "standard practices" and had an initiative on the side to explore better options vs working with someone who insisted on "best practices" because of their insecurity and shaky authority.
Zealous adherence to "best practices" is actually a good sign of immature developers.
The identity begins to attach to things that fit that timeline, as in, ‘I am roughly here and therefore based on how I see myself, I should be aligned to what I perceive my identity to be’. This realignment means they eat up any and all bullshit they see at a developer conference or resort to appealing to authority (‘this is how Google does it’). And why wouldn’t they, they are in their eyes almost there, almost like the best.
Ultimately, this is still sincere, just leads to dumb results at times (eh, more like often). It is a form of establishing your own authority by associating yourself with authority, a coopting of something undeserved, but emotionally fulfilling. You feel like 6-7 years is enough, but it just ain’t. In it’s worst form, this is what it is and it’s pretty annoying to deal with.
/end Saturday morning psycho babble
At the start I followed design patterns religiously. I was proud that I'd use those patterns. I wrote about them. I told employers. They employers were impressed. The code was an over-engineered mess. But it ticked the best practices box.
It still happens now. But this is mainly because management and other developers are enthusiastic about various techniques that have the label "best practice".
I last left a codebase in an international firm where everything was a dependency and everything was injected and everything was orchestrated. Everyone was enthusiastic that they finally had a codebase with dependency injection everywhere. I hope to never see that codebase again.
Coming to terms with the business side is the first step.
Having your best practises or framework mocked by the next generation of zealots is part of the process. Patterns you know and love become anti-patterns only to return in a distance future in some limited formed with great fanfaire.
Letting go and a realizing your project / patterns will get hijacked by the business side, other developers and often enough pms is freeing.
The problem is not so much the individual rules, but the "black and white thinking": believing that everything in programming (or life) can be distilled to very simple rules, without nuance or prior thinking before applying them.
It's a very comfortable position to be in, but it severely hampers your professional development.
Presumably everyone thinks their own practices are the best, otherwise they wouldn’t be doing them.
‘Accept best practices’ just sounds like ‘do it my way because it’s the best’.
It’s hard to argue with “you should use a version control” unless you have a very good reason not to.
However, if you get into the “you should always use single quotes” argument, in my opinion, that’s too shallow to be a “best practice”.
On a similar vein... whatever it is you're doing, it's an anti pattern.
'There is a Glittering Generality if I ever heard one'
It's an important stage. But people who stay in this stage too long become intolerable technical architects who yammer away about best practices and high level company goals, produce technical documents no one reads and plan team building events no one wants to attend.
To me stage 3 involves thinking critically about tradeoffs. Applying best practices in relevant contexts and rejecting them in others is a good example.
I always end up linking this silly blog post. https://medium.com/@webseanhickey/the-evolution-of-a-softwar... It sums up the seniority growth cycle better than I can in words.
Best practice is to refer to this as "Chesterton's Fence."
Corollary: any expert in a particular area should know better than best practices to deal with a given problem.
Best practises are negotiable if you can attack them with first principles. This is the basis of critical thinking, which I think is more important than best practises.
Best practises will get you fast social agreement though, whilst critical thinking will upset many people because you challenge their idea's trying to find issues early or better options.
I'd agree with and extend your remarks, if you can clearly document why you're creating your own best practice, then its OK. Or rephrased in a negative sense, If you can't clearly write and permanently document an explanation, then you probably don't have a good reason.
It’s just easier to say “Always follow” as you should always follow best practices until you have a great reason not to.