As such, it's hard for me to bring myself to respond to any one point in the piece. It'd be quite easy for most of us to do so, but I suspect that was the intention.
I think the author might be taking it a bit too far, but they are certainly describing a real thing that I see all the time. Which is bad engineering choices made without thinking and then justified with a string of design pattern terms, used incorrectly.
I’ve been part of lots of teams and teams composed of great and poor levels of talent and I’ve never seen this type of behavior which you describe. Usually the folks getting up in arms over architecture are pissed because folks with experience shot down their idea for reasons of pragmatism and the individual couldn’t handle it because of ego.
One of the most interesting things I learned was how much variance there was in code size between submissions. I would first read an assessment from a good student which was completely correct and 500 lines long. The code would seem reasonably clear, compact and well written. Then I'd pick up the next assignment, which had also gotten 100% on the automatic tests and it would be only 150 lines of code. And the code wouldn't seem any more compact or unreadable compared to the first - they both looked like decent solutions; but one of those solutions had implemented the same spec in 3x less code!
And then I'd pick up a submission by a weaker student who got 50% of the automarking results done. The submission would be 600 lines, and you could see the sweat that had gone into writing it. The student was clearly struggling to keep track of all the moving parts in their code. If that was all I looked at I would have assumed the assignment would have taken 1000 lines to implement, and be way too hard for my first year students.
(In case you're wondering, there was no difference in programming languages, tooling or knowledge. All students were using the same environments to write plain C code.)
The lesson I learned was that its very hard to tell whether you or your coworkers are actually using a good approach to solving your problems. I never hear people say things like "Oh, I think this different abstraction could save us 70% of our code". But having seen enough examples I think its usually the case that those abstractions exist. We just (bizarrely) don't seem to spend any time looking for them. Intuitively I would expect that bad abstractions would be obvious in code, but that seems to be often not true in practice. After reading the first students' submission I usually would still have no idea how long the average correct submission was going to be.
I heard colleagues say "if we split this away, join these two classes into one and hide it under interface, it will be simpler/shorter". The word abstraction was not used, but it was abstraction they were talking about.
So maybe it depends on local culture, whether people talk about how things are done overall or whether they focus on idioms only.
Edit: fixed typo in clearn/clear
Factories: generate objects whose type can freely change. See polymorphism.
Visitors: create any operation you'd like to implement without having to change a type. See open/close principle.
Repositories: separate SQL voodoo from your code and establish a dedicated component to handle database transactions.
Façade: isolate the world from all the gory detail in a manner that you are free to change both the component and its clients. See separation of concerns.
I find it more worrying that the code developed by a senior developer was dumped just because the junior developer who replaced him was entirely clueless and not obly unable to understand existing codebut also unable to even grasp basic design problems that justify the senior developer's decision.
Recommended reading: https://en.m.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fen...
What you fail to grasp was the code was so completely unnecessarily complicated that it introduced a fuckton of subtle bugs that were difficult to track down. Things would look like they're working, and then reports of terribly broken behavior forcing an emergency rollback followed by days of trying to figure out what bullshit state things were in to repro the problem.
Worse, is so much of the code was some misguided attempt to future proof the code in ways that make no sense. When your code will never have more than a couple dozen simple sql queries you will never benefit from a polymorphic sql class intended to allow the swapping out of your sql backend with another vendor. It's easier just to rewrite that small piece of code when the time comes.
Just because you can implement fizzbuzz using a dozen design patterns doesn't mean the problem actually requires it.
Well, the anti-pattern that describes this kind of logic is the Straw Man. If all Design Pattern articles were theoretical blah blah blah, The Fine Article might have a point. They aren't. Not even the majority. As long as we just point to the (bad) minority, and act as if they're representative of the whole, then we can continue to hate all articles about design patterns, and play — because this is just as much a form of "play" as the "learning" or "avoiding" techniques being decried — in our preferred, and specifically unstructured way.
The author doesn’t hate design patterns. They hate articles about them.
This left me feeling like nobody really knew, and that everyone was just chucking dirt and hoping it stuck.
Meanwhile,
I've been in this industry for over 35 years. On dark days I'd give my left leg for working templates and strickt design patterns. On good days I love the close to absolute freedom we have.
Perhaps I’m being unfair to Design Patterns, but those articles [about design patterns] seem like the worst kind of tech writing, the most likely to inspire useless discussion that doesn’t help move a team forward. Catering to software developers perfectionism tends to be bad for business. And this particular type of article seems to be the most extreme in that regard.
To recap, DP articles:
- are the worst kind of writing (still no explanation)
- likely to inspire useless discussion (sometimes play is a lie?)
- catering to perfectionism (this can be said about any tool)
The article reminds me of many folks I've met who despise analysis and planning. They're constantly getting themselves into trouble that requires quick action. When it works, the chalk the success up to their quick action. They denigrate project planning tools of nearly every stripe. They're also typically very bad communicators and don't manage time well.
But in the end, the need for quick action resulted from the immense dis-ease the person feels around planning, brainstorming, and up-front analysis. The cycle repeats on every project.
There must be an anti-pattern that describes this kind of behavior...