Hacker News new | ask | show | jobs
by ighost 5978 days ago
I agree that polymorphism is the "right way" if there's already a class hierarchy established.

If the superclass-subclass relationships aren't in place for you (worse yet, they're not set up how you want them to be set up), this hack accomplishes a similar effect with no refactoring.