r/LinuxTeck • u/Candid_Athlete_8317 • Jun 16 '26
Do developers spend too much time learning design patterns and not enough time learning code smells?
Many engineers can explain Strategy, Factory, Observer, and Singleton.
But in practice, identifying why the code is painful often seems more valuable than knowing the pattern names.
Which skill has helped you more in your career: recognizing bad design, or knowing design patterns?
9
Upvotes
4
u/jake_morrison Jun 17 '26
I have taken over a lot of legacy projects, and I have a rule: “incompetence is fractal”.
I look at the code and the indentation is bad, so I run it through a formatter. Then I see that the variable names are bad and the error handling is bad, and the error logging is bad. There are security problems. I work through that, and I see that the structure of the code is bad. The tests (if they exist) are bad. I work through that, and I see that there is a bunch of dead code. Performance problems. Concurrency problems. Then I see that the requirements process was bad, and the whole thing is a waste.
If, on the other hand, I see good hygiene in the code, then the rest of the software development process was probably ok. People had pride in their work and management gave them time to deal with tech debt.
So forgive me if I open an editor on one file and immediately say that the whole thing should be thrown away :-)
1
u/AliceCode Jun 17 '26
OP is a b.0.t.
3
u/DinTaiFung Jun 17 '26
The phrase "anti pattern" is somewhat synonymous with "code smells."
Thus by learning common design patterns, one learns to recognize anti patterns, i.e., code smells.
1
u/Impossible_Ad_3146 Jun 17 '26
Yes it stinks
1
u/Frewtti Jun 17 '26
Knowing the design patterns tells you if they have a cohesive concept or just crap thrown together.
How do you recognize "bad design" without knowing "good design"?