home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!hp4at!sca
- From: sca@gese.ge14.mdadv.gv.at (Petzi Schweda)
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <1992Nov16.094833@gese.ge14.mdadv.gv.at>
- Originator: sca@gese0n.ge14.mdadv.gv.at
- Sender: usenet@hp4at.eunet.co.at (USENET - Admin account)
- Nntp-Posting-Host: gese.ge14.mdadv.gv.at
- Organization: MD-ADV, Vienna, Austria
- References: <140742@lll-winken.LLNL.GOV> <1992Nov6.225622.25460@dg-rtp.dg.com> <604@ulogic.UUCP>
- Date: Mon, 16 Nov 1992 08:48:33 GMT
- Lines: 56
-
-
- In article <604@ulogic.UUCP>, hartman@ulogic.UUCP (Richard M. Hartman) writes:
- > >
- |> >> if ( OpenCode ) ...
- |> >
- |> >Is anyone else as repelled as I am by the practice of leaving the
- |> >parentheses surrounded by whitespace on both sides? Not only does
- |>
- |> I am! I am!
- |>
-
- Me too !
- So we finally agree to
- if (cond statements)
- right ?
-
- !> I finally convinced 'em of the futility of this one though. But they
- |> still insist on:
- |>
- |> if (x == y)
- |> flag = TRUE;
- |> else
- |> flag = FALSE;
- |>
- |> instead of believing that:
- |>
- |> flag = (x == y);
- |>
- |> actually works. What do you have to say about that one?
- |>
- Fine !
- 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 ...
-
- 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 ...
-
- Furthermore the usabiltiy of PD- or shareware-code would be enhanced if
- the guys writing it would have a little eye on gettin' over the ether HOW
- their keen stuff works (I'm far off talking about inline-doc's)...
-
- regards, Petzi
-
- --
- Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
- MD-ADV, Municipality of the City of Vienna, Austria
-
-
- --
- Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
- MD-ADV, Municipality of the City of Vienna, Austria
-