News for hackers. Stuff that matters.
Re:The death of if/else cascades, a lightweight alternative by xtho on Monday December 07, 2009 @12:14AM (#980757)
Instead of mimicing method dispatch, shouldn't this be handled by a factory that returns an appropriate action object?

Okay, the author writes:

> Skeptics may say, that problem has been solved in the Object Oriented world by [...] Wow, that is a lot of work, and think about the number of classes and lines of code you will end up with!

First, you don't have classes in a prototype-based language. Secondly, do it right or don't do it at all.

There are no comments on this comment yet.