←back to thread

Against Best Practices

(www.arp242.net)
279 points ingve | 3 comments | | HN request time: 0.734s | source
Show context
vbezhenar ◴[] No.42171296[source]
How other engineering industries deal with this phenomena? Why those approach do not work with programming? I feel silly sometimes because software development is huge industry and we don't have consensus on basics.

For example I think that strict formatting is a good thing. Since I tried to use Prettier I'm using it and similar tools everywhere and I like it. I can't do vertical alignment anymore, it eats empty lines sometimes, but that's a good compromise.

May be there should be a good compromise when it comes to "best practices"? Like "DRY" is not always best, but it's always good enough, so extract common stuff every time, even if you feel it's not worth it.

I often deal with this dilemma when writing Java with default Idea inspections. They highlight duplicated code and now I need to either disable this inspection in some way or extract the chunk of code that I don't really think should be extracted, but I just can do it and move on...

replies(12): >>42171363 #>>42171370 #>>42171393 #>>42171459 #>>42171531 #>>42171554 #>>42171817 #>>42171829 #>>42172784 #>>42173289 #>>42173799 #>>42174046 #
1. randomdata ◴[] No.42172784[source]
> How other engineering industries deal with this phenomena?

They don't. CAD, the "programming languages" of most other engineering disciplines, is as much of a Wild West.

replies(1): >>42179567 #
2. bigger_cheese ◴[] No.42179567[source]
I'd say Yes and No, there are standardized ways to analyze common engineering problems, for example beam deflection equations https://en.wikipedia.org/wiki/Deflection_(engineering)

or Heat Exchanger efficiency calculations (https://en.wikipedia.org/wiki/Logarithmic_mean_temperature_d...) etc.

Often the models and equations rely on making assumptions in order to simplify the problem (cue the joke about physicist and the spherical cow). This is one of the reasons thing are designed with tolerances and safety factors.

Software like CAD and particularly Computational Fluid Dynamics (CFD) packages can simulate the problem but at least with CFD you would typically perform other types of verification such as wind tunnel tests etc.

replies(1): >>42179995 #
3. randomdata ◴[] No.42179995[source]
I'm not sure that's analogous to "best practices" like "do not repeat yourself (DRY)" or "don't use GOTO". These are little more than stylistic choices that claim to offer more maintainable code. Comparable "best practices" in other engineering fields would be along the lines of "do not chamfer/fillet until the end of modelling" (one I have heard before).

Analyzing a CAD model as you describe is more like running a compiler or type checker on code already written, which is the norm in software too, but is not within in the vein of the topic of discussion.