Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 1996 11:01:19 +0200 (MET DST)
From:      grog@lemis.de (Greg Lehey)
To:        hackers@freebsd.org (FreeBSD Hackers)
Subject:   Indentation styles
Message-ID:  <199605280901.LAA23008@allegro.lemis.de>

next in thread | raw e-mail | index | archive | help
OK, I know source code indentation styles are a hot button, but I
think I need to press it anyway.

First, a question: is there a recommended FreeBSD indentation style?
If not, I think there should be.  

Now, my problem: I frequently modify other people's code, which
sometimes causes me problems in reading, simply because the
indentation varies so much from the indentation that my tools and I
use.  Frequently, I just give up and run the whole source through
indent(1).  The resulting modifications work (usually), but it's
difficult to pass them back to the original author as diffs.

Therefore, my suggestion: if FreeBSD doesn't have a canonical
indentation style, it should get one.  The style should be
reproducible with indent(1). (For those of you who don't know,
indent(1) has a plethora of flags which can create just about any
indentation style you like).  That way, individuals can code in styles
in which they feel comfortable, but when they submit code, it's in the
canonical form.  It would be an advantage, of course, to choose a
canonical form which corresponds to the tastes of the majority.

If there is already a recommended FreeBSD indentation style, can it be
reliably produced with indent(1)?  If not, what do people think about
modifying it to a (closely similar) form which can be created with
indent(1)?

If there isn't a recommended FreeBSD indentation style, do you agree
that there should be one?  What should it be like?

Finally, a restriction.  Indent style can, in some cases, influence
coding style: for example, if you choose an indent of 8 and indent
braces 8 characters and the contents of a block another 8 spaces,
you'll soon run out of margins.  Even if you only indent a single 8
characters, you'll end up writing different code from people running
smaller indents.  Does this matter?

Thoughts?  Flames?
Greg




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605280901.LAA23008>