Re: PgJDBC: code reformat

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>, Markus KARG <markus(at)headcrashing(dot)eu>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PgJDBC: code reformat
Date: 2015-12-27 14:16:03
Message-ID: 567FF2A3.8060003@archidevsys.co.nz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 28/12/15 03:03, Dave Cramer wrote:
> +1 for Gavin's suggestion
> and yes I think mandatory braces are required

When I started programming (back in 1968), I thought that indenting and
the like was a waste of time, as I had to explicitly punch every single
space onto punched cards, But as my programs became more complicated, I
found my code hard to read (even with my then good eyesight). Later when
I started indenting, I found my code far easier to read & understand, so
I am extremely conscious of the value of white space - also very glad
the modern IDE's don't force you to type every single space and manually
assure that code is indented properly!!!

I always use brackets for if statements, as it make it much easier to
add additional lines without accidentally introducing a programming bug.

Cheers,
Gavin

>
> Dave Cramer
>
> davec(at)postgresintl(dot)com <mailto:davec(at)postgresintl(dot)com>
> www.postgresintl.com <http://www.postgresintl.com>
>
> On 27 December 2015 at 09:01, Gavin Flower
> <GavinFlower(at)archidevsys(dot)co(dot)nz <mailto:GavinFlower(at)archidevsys(dot)co(dot)nz>>
> wrote:
>
> On 28/12/15 01:15, Dave Cramer wrote:
>
[...]
>
> I much prefer to line the brackets up on the same side, it makes
> the code a lot easier to read. Even in the days of screens with 25
> lines of 80 characters - now with considerably larger monitors, it
> makes even more sense.
>
> So I very much prefer the style:
>
> if (q)
> {
> do something
> }
>
>
> When I had poor eyesight it was easier, and after multiple eye
> operations & my eyesight is much improved - I still prefer the
> style with the brackets on separate lines.
>
> If I want to understand someone else's code sample; I refactor a
> copy of their code into this style, as it greatly increases the
> ease of reading it. The other style looks cluttered, and is harder
> to see the blocks of code clearly
>
>
> Cheers,
> Gavin
>
>
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vladimir Sitnikov 2015-12-27 15:01:56 Re: PgJDBC: code reformat
Previous Message Dave Cramer 2015-12-27 14:03:17 Re: PgJDBC: code reformat