If products were objects, you could define a class for each type of product and call a single method on each object. With the individual classes, you could override the method to do the appropriate thing for the product type.
(This is the Replace Conditional with Polymorphism refactoring. It's one of my favorites.)
In reply to Re: 'Variable' sub names
by chromatic
in thread 'Variable' sub names
by merrymonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |