|
|
|
|
|
by elemeno
4767 days ago
|
|
GoF is, in my opinion, about establishing a language to talk about commonly used constructs in languages - especially given it's providence in Christopher Alexander's A Pattern Language. Referring to it as 'a set of tricks' would suggest to me that you've only given it a cursory glance and assumed that it's just about copying out example blocks of code, or that 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. Having a way to discuss the architecture of a piece of software without having to explain every implementation detail because there's already a shorthand refer to various parts of it is invaluable when working on larger projects. Being able to call a block of code as a flywheel is no more a trick than being able to refer to an options pricing equation as a 'modified black-scholes' - the important part is that other person knows from that what you're talking about and so you can get to the important part of the conversation. |
|
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.)