←back to thread

Against Best Practices

(www.arp242.net)
279 points ingve | 8 comments | | HN request time: 0.809s | source | bottom
Show context
larsrc ◴[] No.42171384[source]
Follow best practices unless you can give a reason not to. "Best practice" is a shorthand for a lot of accumulated knowledge that you don't want to go over again every time. Also following BP makes the code more consistent and thus easier to understand. But when an argument arises, go back to the underpinnings of the best practice and work from there.
replies(6): >>42171403 #>>42171433 #>>42171565 #>>42171805 #>>42171879 #>>42171960 #
1. ohthatsnotright ◴[] No.42171433[source]
Often what is one developers "best practice" is another's "anti-pattern" because a lot of this is just arbitrary.
replies(4): >>42171555 #>>42171558 #>>42171648 #>>42171680 #
2. pletnes ◴[] No.42171555[source]
Hot take, the biggest advantage to following «best practices» is that when someone else stumbles over your project, they can follow along more easily
3. Angostura ◴[] No.42171558[source]
If it is arbitrary, it’s “standard practice”.
replies(1): >>42171983 #
4. pydry ◴[] No.42171648[source]
There are many like that. Every practice is a trade off.

However, there are many where the cost/benefit ratio is so large that you can default to "you should just do this".

I dont think Id ever look at a company that e.g. had no CI or versioning for a large project for instance and think "they might have had a good reason for this". They didnt.

5. ahoka ◴[] No.42171680[source]
There’s usually nothing “best” about it.
6. lolinder ◴[] No.42171983[source]
Which still has immense value.

It's standard practice to install outlets with NEMA connectors in North American buildings. Sure, you could technically swap those out with a more optimal connector that is "better" (one that prevents electricity from flowing while the plug is partially exposed, for example), but using the standard practice is best practice for human-shaped reasons that are often not apparent to early-career engineers.

replies(1): >>42174610 #
7. dambi0 ◴[] No.42174610{3}[source]
I’m a bit confused with the analogy here. Would the non NEMA outlets work with my existing things or is the implication that they wouldn’t?
replies(1): >>42178111 #
8. lolinder ◴[] No.42178111{4}[source]
They wouldn't, but about half of the developers commenting here would do the equivalent of switching from NEMA to something else on the grounds that the something else is better.