home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!news.univie.ac.at!hp4at!sca
- From: sca@gese.ge14.mdadv.gv.at (Petzi Schweda)
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <1992Nov20.093957@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> <aaronk.193.722052372@county.lmt.mn.org>
- Date: Fri, 20 Nov 1992 08:39:57 GMT
- Lines: 37
-
-
- In article <aaronk.193.722052372@county.lmt.mn.org>, aaronk@county.lmt.mn.org (Aaron S. Kurland) writes:
- !> 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.
-
- think you'll end up a little bit messy when using this one inside blocks:
-
- for (...)
- {
- if (cond)
- {
- state;
- }
- else
- {
- state2;
- }
- }
-
- too much paranthesis in this column, for my taste ...
-
- go for it, Petzi
- #####################################################
- Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
- MD-ADV, Municipality of the City of Vienna, Austria
-