Mailing List Archive

indentation
On Tue, Mar 16, 2004 at 07:08:09PM -0000, Aaron Stone wrote:
> I'm a fan of GNU style, with two spaces between levels and curly braces on
> intermediary levels by themselves. All but their stupid function format.
> Nobody should have to #ifdef every single function with K&R compatibility;
> that's just dumb.

My preference is that tabs should be used for indentation at the
beginning of lines and spaces should be used for any spacing within
lines.
This allows each developer to set tabs as wide as they like in their
editor and the code always looks fine.

f(x) {
for (i = 0; i < 10; i++) {
someVar = "abc";
someOtherVar = "xyz";
i = 5;
}
}
Re: indentation [ In reply to ]
You know, I work on another project where we often line things up like that in
the middle of a line, and I swear there's one guy with some bizarre tab stop,
because every time he plays with a section of code like that, stuff is all
over the place and someone else has to rearrange it! We all just kinda took it
in stride, but this is a perfect solution (and a big ol' "duh" too) :-)

Aaron


""Christian G. Warden"" <xndbmail@xerus.org> said:

> On Tue, Mar 16, 2004 at 07:08:09PM -0000, Aaron Stone wrote:
> > I'm a fan of GNU style, with two spaces between levels and curly braces on
> > intermediary levels by themselves. All but their stupid function format.
> > Nobody should have to #ifdef every single function with K&R compatibility;
> > that's just dumb.
>
> My preference is that tabs should be used for indentation at the
> beginning of lines and spaces should be used for any spacing within
> lines.
> This allows each developer to set tabs as wide as they like in their
> editor and the code always looks fine.
>
> f(x) {
> for (i = 0; i < 10; i++) {
> someVar = "abc";
> someOtherVar = "xyz";
> i = 5;
> }
> }
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>

--
Re: indentation [ In reply to ]
As far as indentation goes, I'm with Christian. Spaces should be used for spacing within lines. I've always liked lining up variable initalization's or a lot of variable assignments as it makes things easier to see IMHO.

Braces on the other hand, I've always been partial to:

f()
{
for (i = 0; i < 10; i++)
{
some_var = "abc";
some_other_var = "xyz";
i = 5;
}
}

But I don't care so much about the braces as I do about the indentation. Tabs are easy to set to personal preferences without messing up someone else's view of things.

On Tue, Mar 16, 2004 at 11:17:47AM -0800, Christian G. Warden wrote:
> On Tue, Mar 16, 2004 at 07:08:09PM -0000, Aaron Stone wrote:
> > I'm a fan of GNU style, with two spaces between levels and curly braces on
> > intermediary levels by themselves. All but their stupid function format.
> > Nobody should have to #ifdef every single function with K&R compatibility;
> > that's just dumb.
>
> My preference is that tabs should be used for indentation at the
> beginning of lines and spaces should be used for any spacing within
> lines.
> This allows each developer to set tabs as wide as they like in their
> editor and the code always looks fine.
>
> f(x) {
> for (i = 0; i < 10; i++) {
> someVar = "abc";
> someOtherVar = "xyz";
> i = 5;
> }
> }
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev

--
indentation [ In reply to ]
Hi

<takes defensive position>

I've done the indenting stuff. All sources are now in K&R format. For
people who don't like K&R.. uhm, well, you should!

Have a great weekend! Hope your weather is better than mine.. rain rain
rain..

Ilja