If the test would have appeared in 20 places, I would find it very reasonable to use inheritance to abstract out the check. And if the if would have been a case statement, well eliminating that is exactly what inheritance is for!
OTOH if the test would have appeared but once, that is a different issue...
In reply to Re (tilly) 2: Hacking with objects
by tilly
in thread Hacking with objects
by frankus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |