home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11493 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.8 KB

  1. Xref: sparky comp.lang.c:11493 comp.lang.c++:11388
  2. Newsgroups: comp.lang.c,comp.lang.c++
  3. Path: sparky!uunet!microsoft!wingnut!philco
  4. From: philco@microsoft.com (Phillip Cooper)
  5. Subject: Re: Pascal vs C
  6. Message-ID: <1992Jul22.201454.26298@microsoft.com>
  7. Date: 22 Jul 92 20:14:54 GMT
  8. Organization: Microsoft Corporation
  9. References: <1992Jun13.152010.15968@aplcen.apl.jhu.edu> <1992Jun13.220259.17547@beaver.cs.washington.edu>
  10. Lines: 38
  11.  
  12. In article <1992Jun13.220259.17547@beaver.cs.washington.edu> andrewb@lynx.cs.washington.edu (Andrew Berg) writes:
  13. >ded@aplcen.apl.jhu.edu (nod sivad) writes:
  14. >: >You can use "goto" e.g.
  15. >: >
  16. >: >{
  17. >: >   for(...) {
  18. >: >      for(...) {
  19. >: >         if(...) goto exloop;
  20. >: >      }
  21. >: >   }
  22. >: >exloop:
  23. >: >}
  24. >: >
  25. >: >Sure, it is not a very good style, but is should work.
  26. >: 
  27. >: On the contrary, it is excellent style.  Purists will claim you 
  28. >: should use a flag to break the loops, but this both makes the code slower and
  29. >: more opaque.  Your method is the preferred method with C and C++; don't
  30. >: listen to the demands of flatulant purists ;-)
  31. >: 
  32. >: Ada has a better method, but that's a different newsgroup.
  33. >: 
  34. >:                     me
  35. >
  36. >I think that the only time goto's are inherintly bad is when they are used 
  37. >hither and thither (as in BASIC).  Breaking out from a loop, especially if the
  38. >label is well named, should not pose a readability problem to anyone, whereas
  39. >using a bunch of flags and patchy logic can cause terriffic stress headaches
  40. >even for the origional programmer.
  41. >
  42.     What is it with this group and BASIC?  Are you people that
  43. out of touch? GOTOS and line numbers have not been used in BASIC
  44. programs in YEARS!  I know it is stylish to look down your noses at
  45. this language, but if you still think of BASIC in terms of line numbers
  46. and GOTO's, you're living in the the distant past.
  47.  
  48. Phil.
  49.  
  50.