←back to thread

Against Best Practices

(www.arp242.net)
279 points ingve | 1 comments | | HN request time: 0s | source
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 #
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 #
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 #
auggierose ◴[] No.42172796[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 #
1. bayindirh ◴[] No.42197713[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