Standard indentation?

-=/ Larry Hastings /=- funkstr at ucscb.UCSC.EDU
Wed Dec 7 19:05:37 AEST 1988


+-In article <NELSON.88Dec5142722 at sun.soe.clarkson.edu>,
+-nelson at sun.soe.clarkson.edu (Russ Nelson) wrote
+----------
|
| I know, this is a religious question.  However, I would like to know if
| anyone has codified a standard for indentation of C programs?
|
+----------

  Ain't no such animal; never will be.  In fact, the UNIX program indent(1) has
more options than ls(1).
  One thing I might suggest... if you're still deciding on whatever standard
YOU are going to use, you could lean towards something you could define with
indent options.  THAT way, whenever you are looking at someone else's code,
(someone else who, of COURSE, completely disagrees with your style of indenting,
to the point of distraction) you can run it through indent so it will
suddenly become READABLE.
  There is also cb(1), the original C pretty printer, which (I believe)
formats your program to the indentation standard that K&R uses.  cb is generally
more available than indent.  Also, cb won't change your code at all; indent
is known to mess around with comments and sometimes declarations.

--
 /|\ /|\   .. .  .   .    .     .      .       .        .         .          . 
| |\| |\|  .. .  .   .    .     .      .       .        .         .          .
|/|\|/|\|/||   _  _ _   _ |_| _  _ |_ -__  _  _ARPA: funkstr at ucscb.ucsc.EDU
  | |/| |/|L_ (_\( ( (_/  | |(_\_) (_ || )(_)_)UUCP: *!ucbvax!ucscb!funkstr
   \|/ \|/ larry      /   hastings        _/   WORK: sun!acad!metaware!funkster
MetaWare Incorporated   Disclaimer: It was a bad day.
"If any of your OSF force are caught or killed, the Secretary will deny any
 knowlege of your activities."  --from the new Mission: Impractical



More information about the Comp.lang.c mailing list