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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mcsun!hp4at!sca
  3. From: sca@gese.ge14.mdadv.gv.at (Petzi Schweda)
  4. Subject: Re: The Correct Way To Write C if-Statements
  5. Message-ID: <1992Nov16.094833@gese.ge14.mdadv.gv.at>
  6. Originator: sca@gese0n.ge14.mdadv.gv.at
  7. Sender: usenet@hp4at.eunet.co.at (USENET - Admin account)
  8. Nntp-Posting-Host: gese.ge14.mdadv.gv.at
  9. Organization: MD-ADV, Vienna, Austria
  10. References: <140742@lll-winken.LLNL.GOV> <1992Nov6.225622.25460@dg-rtp.dg.com> <604@ulogic.UUCP>
  11. Date: Mon, 16 Nov 1992 08:48:33 GMT
  12. Lines: 56
  13.  
  14.  
  15. In article <604@ulogic.UUCP>, hartman@ulogic.UUCP (Richard M. Hartman) writes:
  16. > >
  17. |> >>    if ( OpenCode ) ...
  18. |> >
  19. |> >Is anyone else as repelled as I am by the practice of leaving the
  20. |> >parentheses surrounded by whitespace on both sides?  Not only does
  21. |> 
  22. |> I am! I am!
  23. |> 
  24.  
  25. Me too !
  26. So we finally agree to
  27.      if (cond statements)
  28. right ?
  29.  
  30. !> I finally convinced 'em of the futility of this one though.  But they
  31. |> still insist on:
  32. |> 
  33. |>     if (x == y)
  34. |>         flag = TRUE;
  35. |>     else
  36. |>         flag = FALSE;
  37. |> 
  38. |> instead of believing that:
  39. |> 
  40. |>     flag = (x == y);
  41. |> 
  42. |> actually works.   What do you have to say about that one?
  43. |> 
  44. Fine !
  45. Generally I would tend to use the "if"-way if what's happening upon the 
  46. condition has a major influence on the behavior or structure of the program,
  47. and the "=(==)"-style when "flag" isn't so important at all ...
  48.  
  49. By the way, I think that the whole discussion isn't one of "personal taste" 
  50. or something like that - much more it's about how someone can get a 
  51. feeling what some code written by somebody else does.
  52. If your'e working in an ivory tower whatever makes you work happy is perfectly
  53. right - but when working as a group (wer'e here 6) you have to establish
  54. conventions to avoid misunderstandings and save time and money ...
  55.  
  56. Furthermore the usabiltiy of PD- or shareware-code would be enhanced if
  57. the guys writing it would have a little eye on gettin' over the ether HOW
  58. their keen stuff works (I'm far off talking about inline-doc's)... 
  59.  
  60. regards, Petzi
  61.  
  62. -- 
  63. Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
  64. MD-ADV, Municipality of the City of Vienna, Austria
  65.  
  66.  
  67. -- 
  68. Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
  69. MD-ADV, Municipality of the City of Vienna, Austria
  70.