←back to thread

Against Best Practices

(www.arp242.net)
279 points ingve | 7 comments | | HN request time: 0.978s | 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. 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 #
2. 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 #
3. 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 #
4. lolinder ◴[] No.42171921[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.

5. nine_k ◴[] No.42171997[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 #
6. throw310822 ◴[] No.42172098{3}[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.

7. f1shy ◴[] No.42174824[source]
I could agree. It boils down to “you have to use your brain, and not try to invent and follow blind some rules”