3 ms·
You can't not use patterns, period. You can only be intentional or accidental in how you apply them, and careful or careless in your intentional application as
by InclinedPlane 8y ago
You can't not use patterns, period. You can only be intentional or accidental in how you apply them, and careful or careless in your intentional application as well.
The problem with patterns is, as with most things in tech, relying on them like they are magic and using them to show off rather than simply being pragmatic. The other big problem is viewing the GoF book as the bible and the end of the discussion about patterns rather than just the start of a conversation. The GoF list of patterns includes a bunch of workarounds for limitations in Java which are simply not applicable in other languages. It also missed plenty of patterns that are useful in other kinds of programs. And it can give the impression that in any decent system you need to cram every conceivable pattern when the reality is that most of the time you're going to be heavily leaning on a tiny handful of patterns.
Edit: some other issues at play here are not doing the work to identify and document existing patterns, especially bad or less good ones (like big ball of mud) and developing a culture of using pattern language to describe existing codebases.
Also, it's a bit rich to talk about patterns "failing" when every modern language leans heavily on iterators, decorators, commands, delegates, facades, and factories. The heavy lifting blue collar patterns are out there doing the work without getting the recognition.
- dragandj 8y ago> bunch of workarounds for limitations in Java While i agree with you, I just want to point out that the GOF book was written before the release of Java (and its rise to popularity) and that the book uses C++ and shows bunch of workarounds for limitations in C++, not in Java.
- jhanschoo 8y agoI'll go further: it seems as though that when Java was designed, there was express consideration that design patterns would find clear expression and use in Java. That is, it is not the case that design expressions are suitable for Java because of uninspired design, but because Java was designed to support programs making heavy use of design patterns.