by sorincos · 13y ago · 0 comments
Now this is a very bold statement. I'm dying to hear more on how you can get rid of design patterns with first-class functions. Does it mean getting rid as in: sharing knowledge is not needed anymore and programming becomes art as we all head to the rapture?
Instead of books of design patterns, you have code libraries with APIs, and you don't have to rewrite the code following the pattern for each new project.
The less expressive the language is, the more need there is for template-style design patterns. The more expressive the language is, the more patterns can be implemented in reusable code.
Also, one interesting aspect of interfaces is that they act as tags, allowing for stricter formal contract checking (as in: am I registering a function to this Observable which is meant to deal with its events, or is it just a coincidence that the function signature matches?).
To see this in action, try googling "factory pattern in Python". You will find hardly any results.