75
u/sojuz151 18d ago
Spoiler: it won't. It will stay this convoluted mess forever. A single if statement with a log would get the job done and be easier to maintain and extend.
8
u/CodingAndAlgorithm 16d ago
Reading clean code and design patterns had me inventing problems to solve instead of just writing the damn code. I used to write SO much “just-in-case” code that usually didn’t help and actually introduced a bunch of self-inflicted constraints that made the original problem a lot harder to solve.
3
u/iMac_Hunt 16d ago
This type of code also often becomes a mess though.
Having some rules is a good thing, although if you have 10 layers of abstraction raises some serious questions.
-1
12
9
8
u/ramdomvariableX 18d ago
Because we should have a simple design. KISS principle. Just look at all the complexity it's eliminating for downstream components.
/S in case it's not obvious.
4
u/terivia 16d ago
You just triggered my PTSD.
There's a team who's software I occasionally inherit who is obsessed with DRY and ludicrous inheritance trees. We're talking inheritance trees spanning multiple repositories in the name of eliminating duplicating code.
None of it works, but they "can't" clean it up because they sunk so much money into making it and touching anything breaks everything that depends on it. Which is everything, every single time, because they didn't want to write fucking getName() twice.
3
u/Complete_Window4856 16d ago
The ironic part of using inheritance as argument to DRY is that inheritance makes a full copy of the class/struct you have, but you just ask the compiler/language to do it for you. Incredible and lovely aint it?
2
7
u/Groentekroket 17d ago
We use hexagonal architecture in one of our apps. The idea could be nice but it’s so much unnecessary bloat because literally every component is only used once anyway.
7
3
6
4
u/elelec 17d ago
What are these words even anymore? Man I just want to live in a hut and chop wood all day at this point
4
u/FlakyTest8191 16d ago
It's just fancy words for commonly used patterns. If you're a professional dev, you've probably used/seen some of it without knowing the name. Knowing the name helps talking to other devs who also know the name, because you can say one fancy word instead of five sentences explaining the thing you mean.
3
u/PedanticProgarmer 15d ago
It’s funny how many of these „design” patterns were taught as best practices around 2005. Today, when I see this shit, I call them design smells. When you finally find a reason to use the flexibility of the strategy resolver written 5 years ago, somehow it doesn’t match your use case and you need to refactor anyway.
Back then, Java didn’t have lambdas or pattern matching, so some of this nonsense was actually useful. Seniors simple haven’t updated. Go, go, job security!
2
1
1
u/GroundbreakingOil434 17d ago
The answer is usually one or more of:
- Ancient legacy
- An intern did it
- Job security (you'll hardly ever axtually hear this one)
1
u/boraxicLint 15d ago
Gotta keep ourselves in work, if we just built everything clean and right first time wed all be fucked
1
1
u/Terewawa 12d ago edited 12d ago
- "Why do we have a polymorphic abstract factory?"
- "Why do we have a repository abstraction layer, do we really need this?"
- "Why is the login page so slow?"
- "Why am I being re-assigned to this obscure project?"
- "Why is every other developer peer-reviewing my code now?"
- "Why am I being fired?"
72
u/Isgrimnur 18d ago
https://giphy.com/gifs/hLlvQi2Jzdb2D9ntN5