[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian coding style?

On Fri, May 07, 1999 at 04:16:35PM -0400, Havoc Pennington wrote:
> Your standard looks much closer to the GNU standard than the Linux one.
> Basically the linux standard squishes the code vertically by putting
> braces on the same line as the code, but expands horizontally by using
> 8-space indent. The GNU standard is horizontally squished with 2-space
> indent but all spread out vertically due to the braces.

And my style is kept reasonable horizontally with 2 space tabs and
vertically by using mostly K&Rish braces..  The only place I don't use
K&R braces is in functions because if I feel ot looks better if the
function header goes over 1 line.

> You'll probably find spaces instead of tabs more convenient when working
> with a diverse group of people with random editors; spaces are less likely
> to get mangled. (I use (setq-default indent-tabs-mode nil) in .emacs to
> avoid tabs. You can remove tabs from a region with M-x untabify.)

I got so used to qedit tabs (spaces) that I don't use anything else
anymore.  Granted this means I have to put up with some other people's
nasty tabstops when I use their code, but it's better for me to not have
to make sure to use spaces so what I do looks right all the time.

> It's also conventional to preserve the author's coding style when
> submiting patches. That is, on your own projects it's fine to use the
> Corel standards, but it would be kind of bad to submit Corel-style code
> to a project that consistently used a different style (since the author
> would have to reformat it).

<AOL>I agree, that's the best way..</AOL>

Joseph Carter <knghtbrd@debian.org>            Debian GNU/Linux developer
PGP: E8D68481E3A8BB77 8EE22996C9445FBE            The Source Comes First!
"All we have to fear is fear itself!"
"And almost but not quite free software..."
"That too."
"And binary only kernel drivers."
"Okay, yeah, that too."

Attachment: pgpnvCeQE4Sg2.pgp
Description: PGP signature

Reply to: