home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:11493 comp.lang.c++:11388
- Newsgroups: comp.lang.c,comp.lang.c++
- Path: sparky!uunet!microsoft!wingnut!philco
- From: philco@microsoft.com (Phillip Cooper)
- Subject: Re: Pascal vs C
- Message-ID: <1992Jul22.201454.26298@microsoft.com>
- Date: 22 Jul 92 20:14:54 GMT
- Organization: Microsoft Corporation
- References: <1992Jun13.152010.15968@aplcen.apl.jhu.edu> <1992Jun13.220259.17547@beaver.cs.washington.edu>
- Lines: 38
-
- In article <1992Jun13.220259.17547@beaver.cs.washington.edu> andrewb@lynx.cs.washington.edu (Andrew Berg) writes:
- >ded@aplcen.apl.jhu.edu (nod sivad) writes:
- >: >You can use "goto" e.g.
- >: >
- >: >{
- >: > for(...) {
- >: > for(...) {
- >: > if(...) goto exloop;
- >: > }
- >: > }
- >: >exloop:
- >: >}
- >: >
- >: >Sure, it is not a very good style, but is should work.
- >:
- >: On the contrary, it is excellent style. Purists will claim you
- >: should use a flag to break the loops, but this both makes the code slower and
- >: more opaque. Your method is the preferred method with C and C++; don't
- >: listen to the demands of flatulant purists ;-)
- >:
- >: Ada has a better method, but that's a different newsgroup.
- >:
- >: me
- >
- >I think that the only time goto's are inherintly bad is when they are used
- >hither and thither (as in BASIC). Breaking out from a loop, especially if the
- >label is well named, should not pose a readability problem to anyone, whereas
- >using a bunch of flags and patchy logic can cause terriffic stress headaches
- >even for the origional programmer.
- >
- What is it with this group and BASIC? Are you people that
- out of touch? GOTOS and line numbers have not been used in BASIC
- programs in YEARS! I know it is stylish to look down your noses at
- this language, but if you still think of BASIC in terms of line numbers
- and GOTO's, you're living in the the distant past.
-
- Phil.
-
-