What are your most used design patterns?
I'm reviewing all sorts of design patterns, just to refresh my memory. What are some of the most used design patterns in the Hacker News community? Just curious. Thanks!
I'm also using delegate and prototype patterns a lot, though those are rather dangerous when misused. Deep inheritance chains or excessive method overrides can easly make the code unmaintainable.
Sample usage:
button =
toggleOn: ->
@trigger 'toggled', 'on'
window =
init: ->
button.listen 'toggled', (buttonState) =>
@showWindow if buttonState is 'on'