DRY is yet another acronym popular with devs. It stands for Don’t Repeat Yourself. Like all nicely sounding acronyms in the field at first look it sounds brilliant. It says that if you wrote something, e.g. some logic, and you find yourself rewriting it somewhere else then you _must_ take this logic and put it in a function and thus write it once and call the function from then on. And it is a reasonable claim to be made. But, as with all things “principles” that come out of people arses and not from actual physical laws it tends to be made to a law (that’s why I wrote _must_) and if you don’t adhere to it you’d be left unemployed scavenging the trashbins. It also tends to be applied like everywhere, from functions (where we saw it make sense) up to Godawful messes of class hierarchies that world would be better off if someone just threw a lit match on. And finally it also is wrong at several other use cases but we, devs, can apparently happily live in a state of schizophrenia. You see the whole document DBs thing (mongo et all) and microservices thing -the fads are very strong with them still- are based on denormalization of data and logic. Denormalization being the elitist term for repeating your self. We are happy to repeat data in doc DBs and we are happy to repeat logic and even full DBs in microservices in order to be blessed by the holly trinity of decoupling, scalability and availability. So, the part of me who is not totally burnt out asks, what happened to the holly DRY principle there. Why the laws of gravity do not apply on some planets and why am I being turned down on interviews when I point that out?
Maybe because we are ridden of people that cannot think critically and are eager to pledge alliance to gurus and corporate bureaucracies thus earning a fatter albeit DRYier* bone. Also because thinking for yourself apparently makes a bad corporate slave.
(*) Sorry for the bad pun. It’s on par though with the SW “principles” we operate by.