in reply to Re: elsif stupid question...
in thread elsif stupid question...

Yeah, presuming an OOP context lots of branches may indicate you should use the "Replace Conditional with Polymorphism" refactoring. Push the different conditional behaviors down into a method in child classes and just call that method.

But again, that presumes a set of circumstances which may not apply in this case.

Replies are listed 'Best First'.
Re^3: elsif stupid question...
by blazar (Canon) on Apr 28, 2005 at 15:53 UTC
    Yeah, presuming an OOP context lots of branches may indicate you should use the "Replace Conditional with Polymorphism" refactoring.
    Indeed, but not only limited to this case. Of course newbies coming from other languages happen to abuse them where e.g. a hash would have been enough, not to say the best thing! But then again it's not something one can know in advance, from a generic point of view. I only did that remark in the hope that it may have been useful to the OP or to anyone else who will subsequently read the thread.