home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13038 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.3 KB

  1. Path: sparky!uunet!portal!cup.portal.com!Aurelius
  2. From: Aurelius@cup.portal.com (Mark Christian Barnes)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: GOTO, was: Tiny proposal for na
  5. Message-ID: <64877@cup.portal.com>
  6. Date: Fri, 28 Aug 92 21:13:32 PDT
  7. Organization: The Portal System (TM)
  8. Distribution: world
  9. References: <714668024@thor>
  10.   <6800007@tisdec.tis.tandy.com><1992Aug26.130335.26725@hemlock.cray.com><MA
  11.  TT.92Aug26122422@physics16.berkeley.edu> <rmartin.714929724@thor>
  12.   <TMB.92Aug28192826@arolla.idiap.ch>
  13. Lines: 20
  14.  
  15. my $0.02
  16.  
  17.  If discussions like this didn't keep happening, I would have
  18. forgotton a couple of C-ism entirely by now:
  19.  
  20. 1) C has a goto statement.
  21. 2) Labels exist separately from the switch construct.
  22. 3) ditto with the break statement.
  23.  
  24.  I do use mid-function returns, i.e. "found it!, get out, done"
  25. ( my functions are almost always less than one page, or else! ).
  26. I usually have my if conditions succeed for the expected
  27. execution path (usually more efficient not to branch), so my
  28. exceptional code is in an else block, perhaps with a return.
  29. This also allows me to declare auto variables at the beginning
  30. of the conditional block, instead of at the top of the function.
  31. Many C dialects (VAX C for one) still don't allow variable
  32. declarations just anywhere.
  33.  
  34.             Regards, Aurelius@cup.portal.com
  35.