A dynamically built dispatch table also offers the ability to add handling for new cases without changing the existing ones. And it has the benefits that it is simpler to do, and doesn't push you to spread your logic across multiple files.
Okay, cool... but I'm not quite seeing how you would set that up. So let's say you have a config file that lists all the allowed cases. Wouldn't you also need to add additional code to handle additional cases, and wouldn't that imply using "multiple files"?
In reply to Re^4: replace conditionals with polymorphism
by doom
in thread replace conditionals with polymorphism
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |