r/programming • • Dec 08 '13

Design Pattern Cheat Sheet

http://www.celinio.net/techblog/wp-content/uploads/2009/09/designpatterns1.jpg
1.7k Upvotes

273 comments sorted by

View all comments

Show parent comments

6

u/[deleted] Dec 09 '13

[removed] — view removed comment

2

u/[deleted] Dec 09 '13

Indeed! Correcting myself, the visitor pattern is a clunky/hack to implement an inferior-and-limited version of map.

Looking in a better light, the visitor pattern is an idea/example in how to put a map function to good use!

2

u/seruus Dec 09 '13

[a] pattern is a clunky/hack to implement an inferior-and-limited version of [a more expressive construction].

Seems to be the gist of it. I remember someone talking about how most design patterns are basically structured ways to make up for the deficiencies of the language you are using.

4

u/Peaker Dec 09 '13

Patterns are exactly workarounds for language deficiencies. That said, Visitor isn't a "function map" but a closed sum type.