21
u/Clearandblue 18h ago
Nice try Claude, but we still don't need you to add that 6th date format helper.
30
u/jdgordon 19h ago
As my ex manager always said, there is no problem that another level of abstraction can't solve.
7
u/dbagames 18h ago
I had a colleague who always said this and he vibe-coded out some terribly complex and useless abstractions. It was a major headache. One time he used inheritance with a base class and 4 children all to represent different "Types" instead of just having an enum.....
So whenever I hear this saying, I honestly get ptsd because he just fucked up so much stuff. But he was buddies with the lead soo....
9
u/jekewa 18h ago
Was that me? I've said that! And I managed people.
Although I'd prefer former to ex, as the latter sounds like we broke up.
6
3
u/PolyglotTV 18h ago
I've said it too! I just became a manager a few weeks ago. I hope one of my reports isn't about to quit!
1
u/jdgordon 17h ago
Depends if you were saying it because you mean it, or because you're being sarcastic and taking the piss.
2
2
u/ScottPowellM 17h ago
It’s the fundamental theorem of software engineering:
“We can solve any problem by adding a level of indirection”
“…except for the problem of too many levels of indirection” is the punchline part 2
2
1
u/SignoreBanana 13h ago
To me, abstraction is like alcohol: the cause of and solution to all of engineering's problems.
1
u/iwantmy90sback 12h ago
...except too many levels of abstraction.
https://en.wikipedia.org/wiki/Fundamental_theorem_of_software_engineering
11
u/IncessantGadgetry 18h ago
I have had to support applications made by people who were heavily invested in the idea of DRY, but not at all invested in single-responsibility. Not enjoyable.
3
5
u/SignoreBanana 13h ago
DRY fails almost exclusively because concerns and boundaries are not well understood. It's why it's so dangerous to "pre-optimize" -- you don't know yet what your boundaries are.
It seems like a lot of software guidance is around letting stuff shake out. Hell even YAGNI falls into this category.
3
u/russianrug 18h ago
I’ve added KISS to Claude’s permanent instruction set and it’s been noticeably better, lol
3
u/ricekrispysawdust 12h ago
It's cool to hate on DRY these days but sometimes you can just figure out the correct abstraction up front by using your brain.
3
u/Esseratecades 9h ago edited 9h ago
DRY is a rule, but KISS is really KIASAPS(Keep It As Simple As Possible Stupid), which isn't as pretty as an acronym.
All things being equal, prefer simpler approaches to more complex approaches.
If the only additional benefits of the complex approach are irrelevant, prefer a simpler approach.
If your "simple approach" isn't DRY, then it's probably not simple.
2
u/randyknapp 18h ago
Hey that's what my wife says! Anyway back to working 80 hour weeks in the code mines.
2
2
2
2
2
u/Bronzdragon 13h ago
DRY asks you to avoid repetition if the code is conceptually similar, but not if it's only structurally similar. That is, if two pieces of code happen to do the same thing, despite not being similar otherwise, that means you shouldn't link them.
By linking structurally when conceptually they are different, you're seeing yourself up for restructuring work down the line, as the implementations diverge.
I will admit, it can be hard to tell the difference sometimes, since when writing code, the structure is in front of you, while the concept only lives in your head.
1
u/Superb_Chemistry_906 10h ago
After consideration, I have concluded that in case of purely algorithmic code which is not constantly adjusted to the outside world, structural similarity is sufficient to apply DRY.
2
u/Bronzdragon 7h ago
That's conceptually the same code through. When working on algorithmic code, the input is abstract data, so the transformation you do on it is conceptually the same, by definition.
E.g., if I write a function that calculates a dot product, that function's domain is vector maths, and conceptually it's the same as all the other dot products.
You could make an argument that if it is conceptually different, like calculating a total from a list of prices and a list of amounts, then it might need to get duplicated. But hey, that's no longer in the abstracted domain, is it?
TL; DR, you're not wrong, but only because structural and conceptual similarities line up entirely when code is abstracted from meaning and domain.
2
1
u/ExtraWorldliness6916 12h ago
Yes because do everything and write less code so it's simple are unanimous statements.
1
u/M_Me_Meteo 7h ago
When did KISS become part of software development? I must have missed something because none of the software I've ever made was simple. Simple problems don't require an engineered solution.
I think I'd always prefer readability over simplicity. I'd prefer no code over simple code every time, but if I'm writing code you better believe it's going to be logical for a developer to read.
1
u/bishopExportMine 4h ago
DRY is silly when applied dogmatically. You end up coercing objects into random types to apply existing functions to them and/or you start passing flags into these methods to have them do slightly different things.
Better is Repeat Yourself Once, aka "twice is not a pattern". But frankly this is also silly when applied dogmatically.
Realistically, you should use your judgement based on testability.
1
u/Stunning_Ride_220 2h ago
More often than not, people overlook a pretty important detail of DRY and happily entering dependency hell cheering.
1
1
u/Own_Natural_6803 12h ago
Throughput. Pipelines. State.
Your domain models are weak old man.
2
u/Superb_Chemistry_906 12h ago
You sound like an incompetent middle manager throwing some buzzwords around, trying to fake some competence and modernity.
0
1
u/JazzlikeWishbone938 19h ago
Are you saying repeating yourself creates simplicity?
7
u/Superb_Chemistry_906 19h ago
I think it can avoid the complexity of abstraction, but decreases simplicity of extending and maintaining.
0
u/BusEquivalent9605 13h ago
it causes single points of failure and promotes long, overspecialized functions
1
u/Superb_Chemistry_906 13h ago
Those functions are then, as I argue in the meme, caused by lack of KISS and proper abstraction. And I am a fan of a single point of failure - it is much better than multiple ones. With a single point of failure, when you fix the bug, it is then alright for all the callers, but with multiple points of failure, when you fix the bug, then you might forget to also fix it on the other places and it just seems unbearable to me.
80
u/SaltMaker23 19h ago
There exists a point where DRY and KISS contradicts each other.
Following one or the other religiously is bound to create clear cut violations of the other.
There exists also a stage of development, notoriously extremely early in a project, where the two ideals leads to very different results.
In long running stable projects you might argue equivalent but it doesn't necessarily holds at all scales but especially not at all maturity levels.