On 04/27/2015 12:46 PM, Petr Jelinek wrote:

Another thing I noticed now when reading the code again - you should not be using braces when you only have one command in the code-block.


There's one exception I, at least, have to this rule, namely when there's a corresponding compound if or else. I personally find this unaesthetic to put it mildly:

   if (condition)
       statement;
   else
   {
       block of statements;
   }



pgindent used to produce stuff like this, and you had to put a comment in the block to get around it, but we stopped that years ago, IIRC.

cheers

andrew



--
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