home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16704 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.7 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!sdd.hp.com!saimiri.primate.wisc.edu!ames!kronos.arc.nasa.gov!iscnvx!netcomsv!ulogic!hartman
  2. From: hartman@ulogic.UUCP (Richard M. Hartman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: The Correct Way To Write C if-Statements
  5. Message-ID: <628@ulogic.UUCP>
  6. Date: 18 Nov 92 00:25:13 GMT
  7. References: <1992Nov12.101654.21932@thunder.mcrcim.mcgill.edu> <1992Nov12.140710@gese.ge14.mdadv.gv.at> <3860@dozo.and.nl>
  8. Organization: negligable
  9. Lines: 44
  10.  
  11. In article <3860@dozo.and.nl> jos@and.nl (Jos Horsmeier) writes:
  12. >In article <1992Nov12.140710@gese.ge14.mdadv.gv.at> sca@gese.ge14.mdadv.gv.at (Petzi Schweda) writes:
  13. >
  14. >Well, I think it was Dennis M. Ritchie himself who did this, although
  15. >I have seen BCPL programs, formatted like this. I find the Pascal like
  16. >indentation style just a funny looking as the C like style they used in 
  17. >the book `Software Engineering in Pascal'. It goes something like this:
  18. >
  19. >if I = TRUE then begin
  20. >    J:= J+1;
  21. >    I= FALSE
  22. >end
  23. >
  24.  
  25. The Grogono book (the standard when I learned this silly language)
  26. did this:
  27.  
  28.     IF index < maxwordlen
  29.         THEN
  30.             BEGIN
  31.                 index := index + 1;
  32.                 word[index] := currentchar
  33.             END;
  34.  
  35. ( redundant indentation! )
  36.  
  37. When I actually used the language I did:
  38.  
  39.     if index < maxwordlen then
  40.         begin
  41.         index := index + 1;
  42.         word[index] := currentchar;
  43.         end;
  44.  
  45. Look familiar?
  46.  
  47. And we (C programmers) think we invented these arguments....        :)
  48.  
  49.         -Richard Hartman
  50.         hartman@uLogic.COM
  51.  
  52. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  53. Disco isn't dead...            ...it's just in witness protection!
  54.  
  55.