X coding style
Egbert Eich
eich at suse.de
Wed May 10 02:41:19 PDT 2006
Keith Packard writes:
> On Mon, 2006-05-08 at 10:04 -0400, Adam Jackson wrote:
>
> > But if you want the brief summary, it's K&R, and the rationale is that it's
> > _the_ common style.
>
> No, it's not K&R; at a minimum, we use a mixture of spaces and tabs to
> achieve 4-character cell indentation almost everywhere. Plus, in the X
> server, the general format is:
>
> if (foo)
> {
> indented body
> }
> else
> {
> indented else
> }
>
> while K&R uses
>
> if (foo) {
> indented body
> } else {
> indented else
> }
>
> I don't care which you use in your own code, but do try to precisely
> match the code in which you are working when making changes.
The latter one was the one used in DDX. I remember that in my very
early days David Dawes strongly recommended this one to me so I got
acustomed to it and have used it ever since.
Today I'm using it because I'm most used to it and it makes code
most readable for me - not to endores a certain persons views or
opinions.
Ch.
Egbert.
More information about the xorg
mailing list