home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sdd.hp.com!saimiri.primate.wisc.edu!doug.cae.wisc.edu!umn.edu!uum1!kksys.com!edgar!brainiac!lmt!aaronk.lmt.com!aaronk
- From: aaronk@county.lmt.mn.org (Aaron S. Kurland)
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <aaronk.193.722052372@county.lmt.mn.org>
- Sender: usenet@lmt.mn.org
- Nntp-Posting-Host: aaronk.lmt.com
- Organization: LaserMaster R&D
- References: <140742@lll-winken.LLNL.GOV> <1992Nov6.225622.25460@dg-rtp.dg.com> <604@ulogic.UUCP>
- Date: Wed, 18 Nov 1992 02:06:12 GMT
- Lines: 45
-
- In article <604@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
-
- [ nasty spaces on both sides of parens examples deleted]
-
- >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?
-
- When I see this I just shake my head and laugh!
-
- What do you think of this style?
-
- if (cond)
- {
- statement1;
- }
- else
- {
- statement2;
- }
-
- I always use the curlys even if there is only one statement in the block so
- if I ever need to add another (or a debug statement) I can do it easily. I
- also like having the curly braces line up with the conditional statment.
-
- Aaron
-
- -----------------------------------------------------------------------------
- "Treasures to satiate desires both subtle and gross."
- - Spalding Gray
-
- My company has not yet accepted my application for Corporate Spokesmodel.
-
- Mail: aaronk@county.lmt.mn.org Flames: alt.dev.nul
- -----------------------------------------------------------------------------
-