home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12771 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  1.7 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!swrinde!news.dell.com!uudell!bigtex!texsun!cronkite.Central.Sun.COM!news2me.ebay.sun.com!exodus.Eng.Sun.COM!morocco.Eng.Sun.COM!landauer
  2. From: landauer@morocco.Eng.Sun.COM (Doug Landauer)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Tiny proposal for named loops.
  5. Message-ID: <l9b4fuINN2kj@exodus.Eng.Sun.COM>
  6. Date: 22 Aug 92 01:01:50 GMT
  7. References: <aldavi01.714376080@starbase.spd.louisville.edu> <rmartin.714435942@dirac> <rw.714437749@frito>
  8. Organization: Sun Microsystems, Mt. View, Ca.
  9. Lines: 28
  10. NNTP-Posting-Host: morocco
  11.  
  12. > ||for main_loop (...) {
  13. > ||  // ...
  14. > ||  for inner_loop (...) {
  15. > ||    // ... complex mess of loops ...
  16. > ||          break main_loop;       // somewhere deep inside the loops
  17.         // ... more complex mess of loops ...
  18.       } // end of inner_loop
  19.       // ... more complex mess of loops ...
  20.     } // end of main_loop
  21.  
  22. Unless you require that the loop name appear on the closing brace as well
  23. as the heading of the loop, this sounds to me like a way to have a goto
  24. whose destination is someplace very far away from the place where the
  25. label name is defined.  Why not just "goto" some carefully-named labels?
  26. Like, say, "continue_main_loop" and "break_main_loop"?
  27.  
  28. > |State variables are preferable to breaks and continues.
  29. > I disagree.  I generally prefer a multi-level break ...
  30.  
  31. I gather from this interchange that the mid-70's Structured Programming
  32. pogrom which attempted to eradicate the "goto" is still striking fear into
  33. the fingertips of programmers in the 90's ????
  34.  
  35. The only language change that I'd suggest is that label names should not
  36. be permitted to be *less* than 14 characters long.  :-)
  37. -- 
  38. Doug Landauer -- landauer@eng.sun.com
  39. SMI[STE]->SunPro::Languages.PE(C++);
  40.