Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!ames!pacbell!osc!jgk From: jgk@osc.COM (Joe Keane) Newsgroups: comp.lang.misc Subject: Re: problems/risks due to programming language, stories requested Message-ID: <2257@osc.COM> Date: 28 Mar 90 01:44:35 GMT References: <1004@micropen> <8218@hubcap.clemson.edu> <1771@awdprime.UUCP> <879@enea.se> <5260@drutx.ATT.COM> Reply-To: jgk@osc.COM (Joe Keane) Organization: Object Sciences Corp., Menlo Park, CA Lines: 32 In article <5260@drutx.ATT.COM> rrg@drutx.ATT.COM (GilmanRR) writes: >switch (type) { > case A: /* A, etc. are #define'd */ > ... /* do stuff for type A */ > /* FALLTHROUGH */ > case B: > if (type == B) { > .... /* do B-only stuff */ > } > /* FALLTHROUGH */ > case C: > ... /* do ABC stuff /* > break; > default: > ... >} A _real_ C programmer does it this way (try this in Ada): switch (type) { case A: /* A only stuff */ if (0) case B: /* B only stuff */ /* AB stuff */ if (0) case C: /* C only stuff */ /* ABC stuff */ }