Re: A small rant about coding style for backend functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A small rant about coding style for backend functions
Date
Msg-id 24178.1194533929@sss.pgh.pa.us
Whole thread Raw
In response to Re: A small rant about coding style for backend functions  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: A small rant about coding style for backend functions  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> If Postgres did have something akin to the Python C style guide, that
> would be excellent.  But all we've got is a standard tabstop of four
> spaces and the five words "Our standard format BSD style".  Don't you
> think that comes across as pretty weak for a project of this size and
> significance?

The reason it's not necessary to be very explicit about that is simple:
pg_indent.  Your code *will* conform to the layout standards by the
time it's released ;-).  Now it's still a good idea to make new code
look roughly like what you see there already, because if you go too
far overboard in ignoring line-length or comment layout conventions,
the code may look a bit awful when pg_indent gets done with it.
But I see no need to burden authors with any advice more detailed
than "make it look like what you see".

Having said that, there are two or three tips worth knowing about
pg_indent's behavior, like when and how to use dashes to prevent
comment blocks from being re-flowed.  But it's a short list.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: interval * numeric operator
Next
From: Tom Lane
Date:
Subject: Re: minimal update