TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NEIL HELLER
from: THOMAS MAEDER
date: 1997-09-04 06:44:00
subject: WHY THE BRACES?

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)

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™.