|
|
|
|
|
by michielderhaeg
644 days ago
|
|
This reminds me of when I was still in university.
During our compilers course we used the "Modern Compiler Implementation in Java" book. Because I was really into FP at the time, I instead used the "Modern Compiler Implementation in ML" version of this book (which was the original, the Java and C versions were made to make it more accessible).
We noticed during the course that my version was missing a whole chapter on visitors, likely because ML's pattern matching made this kind off trivial. One of the other students made a similar remark, that software design patterns are sometimes failures of the language when they have no concise way of expressing these kinds of concepts. |
|
This is pithy, but only applies to some rote design patterns which you have to code every time because the language lacks a good way to factor them out.
Wider-scale patterns often express key approaches enabled by the language, and they can't go onto a one-size-fits-all library or language feature, because you tailor their implementation to your specific needs. They are less like repetitive patterns of a brick wall, and more like themes or motifs that keeps reappering because they are fruitful.