TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NEIL HELLER
from: JERRY COFFIN
date: 1997-09-05 00:41:00
subject: WHY THE BRACES?

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.