home *** CD-ROM | disk | FTP | other *** search
- 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
- From: landauer@morocco.Eng.Sun.COM (Doug Landauer)
- Newsgroups: comp.lang.c++
- Subject: Re: Tiny proposal for named loops.
- Message-ID: <l9b4fuINN2kj@exodus.Eng.Sun.COM>
- Date: 22 Aug 92 01:01:50 GMT
- References: <aldavi01.714376080@starbase.spd.louisville.edu> <rmartin.714435942@dirac> <rw.714437749@frito>
- Organization: Sun Microsystems, Mt. View, Ca.
- Lines: 28
- NNTP-Posting-Host: morocco
-
- > ||for main_loop (...) {
- > || // ...
- > || for inner_loop (...) {
- > || // ... complex mess of loops ...
- > || break main_loop; // somewhere deep inside the loops
- // ... more complex mess of loops ...
- } // end of inner_loop
- // ... more complex mess of loops ...
- } // end of main_loop
-
- Unless you require that the loop name appear on the closing brace as well
- as the heading of the loop, this sounds to me like a way to have a goto
- whose destination is someplace very far away from the place where the
- label name is defined. Why not just "goto" some carefully-named labels?
- Like, say, "continue_main_loop" and "break_main_loop"?
-
- > |State variables are preferable to breaks and continues.
- > I disagree. I generally prefer a multi-level break ...
-
- I gather from this interchange that the mid-70's Structured Programming
- pogrom which attempted to eradicate the "goto" is still striking fear into
- the fingertips of programmers in the 90's ????
-
- The only language change that I'd suggest is that label names should not
- be permitted to be *less* than 14 characters long. :-)
- --
- Doug Landauer -- landauer@eng.sun.com
- SMI[STE]->SunPro::Languages.PE(C++);
-