Most active commenters
  • lolinder(3)
  • bayindirh(3)

←back to thread

Against Best Practices

(www.arp242.net)
279 points ingve | 24 comments | | HN request time: 1.058s | source | bottom
1. 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 #
2. f1shy ◴[] No.42171403[source]
Basically if you know exactly why the best practice/rule is in place, and know for sure it does not apply, just skip it. But not before.

https://en.wiktionary.org/wiki/Chesterton%27s_fence

replies(2): >>42171706 #>>42171819 #
3. 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 #
4. 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
5. Angostura ◴[] No.42171558[source]
If it is arbitrary, it’s “standard practice”.
replies(1): >>42171983 #
6. tajd ◴[] No.42171565[source]
Yeah exactly.

A lot of the time best practice can also mean “we did it this way last time and it was ok”. I don’t think anyone is saying don’t find improvements in “what is currently defined as best practice” and if they are then that’s your problem.

7. 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.

8. ahoka ◴[] No.42171680[source]
There’s usually nothing “best” about it.
9. muro ◴[] No.42171706[source]
That's very reasonable.

‘The reasonable man adapts himself to the world; the unreasonable man persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.’

replies(1): >>42171921 #
10. grifter ◴[] No.42171805[source]
The iThe
11. throw310822 ◴[] No.42171819[source]
I would reverse this: if you can explain to me exactly why your so called "best practice" applies here and now, good. Otherwise it's a nice input to have in the discussion, but nothing more.
replies(2): >>42171997 #>>42174824 #
12. davedx ◴[] No.42171879[source]
What if the "best practice" was invented by a VC funded company (like, just for example, Vercel) desperate to maintain their growth trajectory by any means necessary, including huge marketing pushes to convince everybody the "best practice" is the "best way to do things"?

It's downright dangerous to assume a "best practice" in software development somehow automatically means it's some super distilled wisdom juice. A whole lot of it, in my experience, is just hype and rapid, unquestioning cargo culting slamming in right behind the hype.

Use your fucking brain. If the "best practice" is objectively a good solution to your problem then use it. If not, think of something better.

replies(1): >>42172024 #
13. lolinder ◴[] No.42171921{3}[source]
> Therefore all progress depends on the unreasonable man.

The unfortunate corollary to this is that all retrogression also depends on the unreasonable man. The reasonable person (as defined here) maintains the status quo, for good or ill.

14. auggierose ◴[] No.42171960[source]
> Follow best practices unless you can give a reason not to.

Cargo culting much?

I'd say, follow best practices only if you can say exactly why it is best practice.

replies(1): >>42172011 #
15. lolinder ◴[] No.42171983{3}[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 #
16. nine_k ◴[] No.42171997{3}[source]
It depends on your risk appetite. A best practice likely keeps you away from pitfalls known to the community of the practice but not to you. It also may keep you away from crafting a solution that is optimal for your specific circumstances not known or applicable more widely.

In high-reward / low-risk environment, such as building an indie turn-based retro-style game, go with your gut feeling unless you have a good reason not to.

In a high-risk / dubious-reward environment, such as implementing cryptography, follow the best practices to a t, unless you know intimately how things work and maybe codified some of the practices.

There is a wide gamut between these two extremes.

replies(1): >>42172098 #
17. bayindirh ◴[] No.42172011[source]
I don't think so. For example, If I'm writing something in a programming language I don't know by heart, I start by following the best practices recommended by the language authors, then start to flex them when they become less useful, until I hit a nice pitfall which these best practices are designed to avoid.

This allows me to start faster, and be in a better shape in short term. Then I can flex advice more and more as I understand how a language works under the hood.

replies(1): >>42172796 #
18. bayindirh ◴[] No.42172024[source]
I mean, consuming anything without vetting the source of the information is a bad practice in general.

...or,

The best practice of best practices is vetting the source of the best practice to verify its authenticity.

No?

19. throw310822 ◴[] No.42172098{4}[source]
> A best practice likely keeps you away from pitfalls known to the community of the practice but not to you.

In my experience, many "best practices" are the pitfalls you should be wary about, as they can easily translate into hundreds or thousands of lost hours of work and derail and doom entire projects. (The most annoying part of this is that the real causes won't be found, precisely because "best practices have been followed". Therefore the reputation of the best practice will stay untarnished).

Cryptography on the other hand is a well known example of something you should not touch at all unless you are an absolute expert- that's not even a "best practice" but probably the only reasonable practice.

20. auggierose ◴[] No.42172796{3}[source]
I also read the language tutorial first. But if they don't explain their best practices (and often the explanation is simple), I don't care much for them.
replies(1): >>42197713 #
21. dambi0 ◴[] No.42174610{4}[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 #
22. f1shy ◴[] No.42174824{3}[source]
I could agree. It boils down to “you have to use your brain, and not try to invent and follow blind some rules”
23. lolinder ◴[] No.42178111{5}[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.
24. bayindirh ◴[] No.42197713{4}[source]
I don't mean tutorials, I meant guides. For example Go has guides on how to do something. e.g.: How to Organize a Go Module [0].

[0]: https://go.dev/doc/modules/layout