home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16628 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.8 KB  |  41 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!jvnc.net!princeton!csservices!tyrolia!blume
  3. From: blume@tyrolia.Princeton.EDU (Matthias Blume)
  4. Subject: Re: The Correct Way To Write C if-Statements
  5. Message-ID: <1992Nov16.171436.29210@csservices.Princeton.EDU>
  6. Sender: news@csservices.Princeton.EDU (USENET News System)
  7. Reply-To: blume@tyrolia.Princeton.EDU (Matthias Blume)
  8. Organization: Dept. of Computer Science, Princeton University
  9. References: <140742@lll-winken.LLNL.GOV> <1992Nov6.225622.25460@dg-rtp.dg.com> <604@ulogic.UUCP> <1992Nov16.094833@gese.ge14.mdadv.gv.at>
  10. Date: Mon, 16 Nov 1992 17:14:36 GMT
  11. Lines: 28
  12.  
  13. In article <1992Nov16.094833@gese.ge14.mdadv.gv.at>,
  14. sca@gese.ge14.mdadv.gv.at (Petzi Schweda) writes:
  15.  
  16. [lots of stuff deleted]
  17.  
  18. |> Generally I would tend to use the "if"-way if what's happening upon the 
  19. |> condition has a major influence on the behavior or structure of the program,
  20. |> and the "=(==)"-style when "flag" isn't so important at all ...
  21.                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  22. In this case, you don't need the assignment at all...
  23.  
  24. |> 
  25. |> By the way, I think that the whole discussion isn't one of "personal taste" 
  26. |> or something like that - much more it's about how someone can get a 
  27. |> feeling what some code written by somebody else does.
  28. |> If your'e working in an ivory tower whatever makes you work happy is
  29. perfectly
  30. |> right - but when working as a group (wer'e here 6) you have to establish
  31. |> conventions to avoid misunderstandings and save time and money ...
  32.  
  33. The first convention would be that all members of the group learn to program
  34. in C (all parts, not only the intersection of C and Pascal).
  35. Then nobody would be confused by something common like 
  36.     flag = (x == y);
  37.  
  38. [other stuff deletes]
  39.  
  40. -Matthias
  41.