a lot of design patterns sound scary with all the big words, but they boil down to stuff like "don't put two unrelated things in the same inheritance tree, dumbass". like just don't be stupid and you're probably using them unwittingly
So many programming principles are just reminding people not to put the goddamn oranges in the same bag as the apples, but they don't want to even look at the fruit
yeah like the facade design pattern is incredibly obvious and is partially already covered by "don't repeat yourself". Like, why would you want to write every step of a 12 step process multiple times when you could just write one function that does every step and then just call that? Sometimes these things beget explaining again, but it's certainly something
People often misunderstand the idea of design patterns. Instead of 'here is a pattern you can use', think of them as 'we found a pattern that lots of people already use (because it makes sense), and we gave it a name so everyone can talk about it easier'
yeah that makes sense. I've really only been exposed to them mostly in an academic environment so it always felt like the former to me (I never actually read the book either)
All these design patterns are nice and all until you are on a cheap microcontroller with 8k of flash and, if lucky, 1k of RAM and you begin to think about using bare assembler instead of C. ;)
A lot of the design patterns come from the lack of certain features in the language.
In the OOP Smalltalk language many of those patterns are a waste of time. Because they can be replaced with a simple Closure or Lambda. Smalltalk was based on Lisp. Java and C++ did not have that at the start. So we have visitor-pattern, iterator-pattern, etc.
yeah that too, i was specifically talking about the bridge design pattern, which i really feel like is what most people would do even without being taught it.
It's like the Art of War. It has basic things like "the army needs food" in it. When a field is new, someone has to write down and name the obvious things so everyone can then build on a shared understanding of the basics.
I have had similar problem in a different field once; chatting to someone who's an expert in economics and knows a lot of fancy terms for statistical analyses, while I knew hardly any as a student in maths.
Turns out, they have a dozen terms to describe different ways to use basic-ass linear regression to test if somethings' statistically significantly different.
View all comments
319
u/NomaTyx 1d ago
a lot of design patterns sound scary with all the big words, but they boil down to stuff like "don't put two unrelated things in the same inheritance tree, dumbass". like just don't be stupid and you're probably using them unwittingly