Hacker News new | ask | show | jobs
by throwJan22 1632 days ago
Design Patterns - I think there are a few obvious ones like Singleton and Bridge, a few non-trivial like Strategy and the rest are just historic artifacts for interviews
1 comments

Those are comments on the implementation patterns in the Gang of Four book, which are indeed historically situated in the period of the book’s publication and relate to common solutions to problems then encountered. And indeed many of the non-trivial ones are interchangeable: what is State but a Strategy for handling time? What is Abstract Factory but a Strategy for creating objects?

Underlying this is the idea of a Patterns Language for programming: the idea that specific problems can be categorised into general problem shapes, that a satisfactory solution that fits the shape can be named, and that communication is aided by discussion involving those names. The idea of the patterns language is still very much relevant today. Whenever a developer says “this can be a redux saga” or “we’ll use serverless for that”, they are naming a general solution that they believe fits the shape of their specific problem.

I find the names of the patterns unintuitive, more like a language barrier to adoption. Same feeling I got from AngularJS when it was initially published.
All names are unintuitive. The point of Design Patterns is to have a catalog of solutions with names (aka jargon) so we can have higher-level discussions. This requires those involved in the discussion to have a clear understanding of the pattern, which isn't always the case.