home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!sun4nl!ruuinf!plato.phil.ruu.nl!hjv
- From: hjv@phil.ruu.nl (Hendrik Jan Veenstra)
- Subject: The Correct Way To Write C if-Statements
- Message-ID: <hjv.722370665@groucho.phil.ruu.nl>
- Sender: news@phil.ruu.nl
- Nntp-Posting-Host: groucho.phil.ruu.nl
- Organization: Department of Philosophy, University of Utrecht, The Netherlands
- Date: Sat, 21 Nov 1992 18:31:05 GMT
- Lines: 54
-
-
-
- sca@gese.ge14.mdadv.gv.at (Petzi Schweda) writes:
-
-
- >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;
- >|> }
- >|>
-
- >think you'll end up a little bit messy when using this one inside blocks:
-
- >for (...)
- > {
- > if (cond)
- > {
- > state;
- > }
- > else
- > {
- > state2;
- > }
- > }
-
- Expanding the first suggestion logically would IMO render
-
- for (...)
- {
- if (...)
- {
- something;
- }
- else
- {
- something_else;
- }
- }
-
- Also my preferred way of coding BTW...
-
-
- --
- Hendrik Jan Veenstra hjv@phil.ruu.nl * How can I save my dreams
- Dept. of Philosophy * in the nightmare, in the flood
- University of Utrecht * But I try.
- The Netherlands *
-