3 ms·
There’s a percentage of young developers who, right after learning to program, lean hard into patterns and GoF. You end up with architecture astronaut code pret
by klodolph 2y ago
There’s a percentage of young developers who, right after learning to program, lean hard into patterns and GoF. You end up with architecture astronaut code pretty quickly. Some of these programmers are still unskilled and they are just adding a ton of complexity to a codebase that doesn’t even work yet.
That said, I think the GoF stuff is mostly “stuff that works”, but…
1. A lot of it is specific to the language, or certain languages, and
2. Most of the patterns are useful only rarely.
But there are exceptions. We’re just blind to them. We use the Command pattern for UI programs because it’s a sane way to implement undo/redo. We use the Factory pattern all over the place. YMMV.
The mistake these young developers make is that they use “does this use patterns?” as a proxy for “is this good code?”
- bgribble 2y agoI was tech lead on a team with a guy like this. We sat down and had a long discussion and whiteboard sesh about a piece of code that could/should have been about 500 lines of code in half a dozen files. Walked out of it thinking that he understood the assignment and I should just step back and let him code it up. He came back a week later with something that was about 20k lines of Node.js, all just abstraction piled on abstraction piled on indirection, hundreds of files with like one line of code in each one plus a bunch of imports. "Separation of concerns" taken to the far extreme. 100% statement coverage by the horrible kinds of unit tests that you have to write to get 100% coverage. TBH I feel lucky I came out of that episode with my job, and it wasn't even my code!