NH> How many is too many? Should the switch statement be treated the sa
NH> way goto is: only under duress? (and then, don't let anybody know yo
NH> did it)?
No. There are some cases where switch statements make sense. There
aren't any cases where gotos make sense.
But switch statements tend to grow larger and larger (more and more
cases) as the system evolves. Before adding a switch statement, it's a
good idea to think about solving the problem using dynamic binding.
This will make the initial code more expensive to write, but future
extensions will be cheaper.
Thomas
---
þ MM 1.0 #0113 þ If I were into denial, I'd never admit it.
---------------
* Origin: McMeier & Son BBS (2:301/138)
|