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