Re: mogrify and indent features for jsonb

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mogrify and indent features for jsonb
Date: 2015-04-29 20:04:12
Message-ID: 333064446.759079.1430337852863.JavaMail.yahoo@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

> It's a matter of taste, but I find things a lot easier to
> understand when they are symmetrical. Thus I like all the
> branches of an "if" to be either in a block or not, and I like
> braces to line up either horizontally or vertically. Perhaps this
> reflects my history, where I wrote huge amounts of Ada and other
> non-C-like languages, well before I ever wrote lots of C or C-ish
> languages.
>
> Another case where I think putting a single statement in a block
> makes sense is where the condition of the "if" spreads across
> more than one line. This works particularly well with our BSD
> style brace placement.

My personal preferences are the same on all of that, especially
that the closing paren, brace, or bracket should be either in the
same line or the same column as its mate. If we were going to open
a green-field discussion about what style to *choose* I would be
arguing for all of the above (plus a few other things which are not
current PostgreSQL style).

That said, I feel very strongly that it is important that everyone
use the *same* style. It is far more important to me that we stick
to a single style than that the style match my personal
preferences. The project style seems to me to be that a single
statement is not put into braces unless needed for correctness or
to prevent warnings about ambiguity from the compilers.

By the way, my preference for the above are not strong enough to
want to open up the style choices to re-evaluation. PLEASE, no!

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan de Visser 2015-04-29 20:06:51 Re: mogrify and indent features for jsonb
Previous Message Robert Haas 2015-04-29 20:03:41 Re: Replication identifiers, take 4