home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!pki-nbg!hitkw14!smr
- From: smr@pki-nbg.philips.de (Stephen Riehm)
- Newsgroups: comp.lang.c
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <smr.721477854@hitkw14>
- Date: 11 Nov 92 10:30:54 GMT
- References: <140742@lll-winken.LLNL.GOV> <1992Nov9.194915.1647@keinstr.uucp>
- Sender: news@pki-nbg.philips.de
- Reply-To: smr@pki-nbg.philips.de
- Lines: 57
-
- chaplin@keinstr.uucp (Roger Chaplin) writes:
-
- >Mark Boolootian (booloo@framsparc.ocf.llnl.gov) wrote:
- >:
- >: The following piece was written by Jim Minton, an aspiring C programmer.
- >: I convinced him to let me post it to the net. Happy reading and flames
- >: to /nev/dull...
- >:
- >:
- >:
- >: The Correct Way To Write C if-Statements
- >: by
- >: Jim Minton
-
- >[ stuff deleted ]
-
- >: The indentation level is 4 spaces!
-
- >FWIW, I also happen to prefer 4-space indentation.
-
- >Did y'all notice, however, that the title of this piece has been
- >centered in the `page' by using TABs, and that each TAB is obviously
- >intended to replace 8 spaces?
-
- now you're getting confused. The "indentation level is 4 spaces", it
- doesn't say 'indentation level is a 4 space tab'.
-
- If you use tabs, then there is a 99.9% chance that the next guy that
- reads your code will be disgusted by the fact that you used an
- indentation level of 8 (since that is the normal tab length).
-
- If you are using vi you can use the shiftwidth setting and shifting
- commands to indent your code. Also having autoindent set helps.
-
- ie: set ai sw=4
-
- SHIFT COMMAND INSERT MODE COMMAND MODE
- ------------- ----------- ------------
- indent ^T >>
- outdent ^D <<
- no indent 0^D [no command, use << many times]
-
- I don't use emacs, but I have seen emacs users using something
- similar.
-
- The concept of setting tabs to 4 spaces wide sickens me, simply cus
- normally very very very very very few people have tabs set to anything
- but 8 characters. (myself included)
-
- catchya
-
- -----------------------------------------------------------------
- Stephen Riehm Configuration Management _-_|\
- smr@pki-nbg.philips.de Philips Kommunikations Industrie / \
- Work: +49 911 526 2975 N|rnberg, Germany \_.-.!/
- Fax: +49 911 526 3678 "I was there, now I am here!" v
- "My company speaks another language, I CAN'T speak on its' behalf"
-