Hacker News new | ask | show | jobs
by noodle 1197 days ago
I personally agree with your point of view on what DRY is. But,I don't think that's what's being taught or talked about anymore. When people say DRY they usually mean an abstraction layer that merges two similar concepts into one, and the DRY you talk about is just standard operating procedures. Static analysis tools will ding you on DRY rules if you have code that looks pretty similar, urging you to refactor them to be the same. Etc..
2 comments

Literally had to tune out a super senior employee this morning who was talking about this flavor of DRY.

Invoking the same function from two places in the code with vaguely similar parameters is lot repeating yourself, dude.

Sometimes I wonder if the amount of sanity in the industry is finite and adding more people just makes us all crazier.

Its a zero sum sanity game and the companies trade us around to trying to win the most of it
+100

Which is exactly why static analysis tools that force you to do something need to be shot. Static analysis tools that inform you about a possible duplicate are totally fine. Give me an option to disable that particular instance.

Co-incidentally, micro-services do away with such problems in many cases due to the fact that code is "separate" and thus analyzers and sticklers don't find the "duplicates" and you can write beautifully simple code. Unfortunately it has the opposite problem then of leading to things like this Netflix architecture https://res.infoq.com/presentations/netflix-chaos-microservi... but for something simple like a personal blog (yes I exaggerate - slightly)

In the end I think the only solution is to have the right people and stay small enough to keep the right culture. That probably goes against all your metrics and growth goals of the company of course.

The only term I’ve found that gets me any relief (and honestly, it’s not much) from this sort of people is “idiomatic”

You don’t need to factor out idioms. That’s lunacy.