Hacker News new | ask | show | jobs
by dragonwriter 4767 days ago
> GoF is, in my opinion, about establishing a language to talk about commonly used constructs in languages

I think it philosphically comes in part from that place, but the particular choice of constructs it addresses are a a commonly needed set that a particular language family's lack of expressiveness in certain dimensions required to be reimplemented using basically boilerplate code each time they were used, so it spends a lot of time documenting the set of tricks necessary to implement those constructs in that language family.

> you've not worked in a wide enough set of languages to realize that every language has commonly used patterns for doing particular things, no matter how expressive the language is

The more expressive a language is, the more the "commonly used patterns" can be turned into libraries rather than templates you have to apply with substitution each time you want to use them, and the less need there is for a book documenting the justification with sample code, as you just need the actual implementing code with documentation as to its interface.

OTOH, presentationally, its possible to document constructs is a pattern language for software without as much attention to implementation in a particular language as GoF provides. GoF particular choice of constructs and its choice of how to present them, I think, are very much shaped by desire to serve as an implementation cookbook -- a set of tricks -- for a particularly industrially-popular programming language family as well as providing a common pattern language for software constructs that transcends particular programming language choices (and its success and popularity are in no small part due to its utility as a set of tricks.)