On (01 Sep 97) Neil Heller wrote to Thomas Maeder...
TM> Does it help you if I tell you that well designed code doesn't
TM> contain many switch statements?
NH> How many is too many?
That depends on what you're doing. However, when you look at things,
keep in mind that many instances of switch statements in C can be turned
into virtual fucntion calls in C++.
NH> Should the switch statement be treated the same way goto is: only
NH> under duress? (and then, don't let anybody know you did it)?
That's almost the way I've felt about them for a long time, though in
all honesty I tend to go overboard on it. I'll openly admit that I just
don't like switch statements, and generally consider other solutions
cleaner unless I _really_ have to stretch to make them work.
Later,
Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)
|