back

by layer8·7y ago·view on hn ↗
Nitpick: DRY isn't directly a SOLID concept.

I find SPOT (Single Point Of Truth) to be more to the point than DRY, because it is explicitly about semantics and not about mere syntactic repetition.

3 comments
How have I never seen SPOT. I've read about the idea many times over the last ten years, but weirdly enough I've never seen it put it into an acronym. I feel like rules of thumb in software never quite make it until they're an acronym.

I mean honestly the SOLID advice is pretty terrible, but is so often repeated because it has such a great acronym.

What is suboptimal about SOLID? I’m about to buy into it so I’d like to know.
Bout to see a movie with my wife so here's just a short description for now.

SRP. Advice everyone can agree on, but not very actionable. I've seen a dev make a change to conform to SRP while another dev argued the change was bad because it violated SRP.

Open/closed principle if you look at it's origin this is just terrible advice. So everyone tortures this advice until it says something different

Liskov substitution principle - sure, but as a top 5 most important idea in oop

Interface segregation principle - sure

Dependencies inversion principle - I don't think abstractions are always better than concrete representations. In fact a lot of times they're worse. Humans are trouble at learning abstractions. So bad in fact they can learn abstractions from the concrete so much easier than from abstractions. And this is a huge cost to readability, and it's harder to get correct.

The problem with these acronymed principles is that there are always programmers who will treat them as religion (and senior programmers who will enforce it as such).
> explicitly about semantics and not about mere syntactic repetition

I'm hoping I remember to steal this later!