On Fri, May 01, 2009 at 01:38:38PM -0400, Andrew Dunstan wrote:
> David E. Wheeler wrote:
>> On May 1, 2009, at 8:38 AM, Robert Haas wrote:
>>
>>> Speaking of space/tab settings, one thing I'm fuzzy on is the rule
>>> for wrapping long lines.  I understand that a line that extends
>>> past 80 characters has to be wrapped, but the amount of
>>> indentation on the continuation line doesn't appear to follow a
>>> consistent pattern - or does it?
>>
>> “Perl Best Practices” recommends an indentation of 4 spaces, both
>> for  block indentations and line continuations. Not sure what'd be
>> best for  C, though.
>
> Please, let's not have a whole host of different indentation styles.
> Postgres has a well established style.  Let's stick to it in both
> perl and C.

Perl is not C, and there's no good reason to make them look the same.
We don't format SQL the same way we do C either, and that's a totally
reasonable decision.

Using idiomatic perl like this:

foreach my $element (@array) {
    # clear, short, idiomatic code here
}

instead of Rube Goldberg constructs like this:

my $i;
for ($i=0; $i <= $#array; ++$i)
{
    # kludges up down and sideways here
}

is a good idea because it makes it easier for Perl programmers to
maintain.  It's also more efficient on the machine, for what that's
worth.

Cheers,
David.
-- 
David Fetter <da...@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fet...@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to