pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gavin Flower <GavinFlower@archidevsys.co.nz>
To: Dave Cramer <pg@fastcrypt.com>
Cc: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Cc: Markus KARG <markus@headcrashing.eu>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: PgJDBC: code reformat
Date: Mon, 28 Dec 2015 03:16:03 +1300
Message-ID: <567FF2A3.8060003@archidevsys.co.nz> (raw)
In-Reply-To: <CADK3HHLD3aAWcEPtUXVCxDrLzENvpAGbqC__dYfzrKEz1wh2VA@mail.gmail.com>
References: <CAB=Je-F1PtJ1Dbsswr=oaj2z8KYpZANHW_kLc2y5DuzjpAJqeQ@mail.gmail.com>
	<062c01d14031$c4f01aa0$4ed04fe0$@eu>
	<CAB=Je-GTY_09RLYOA9FgoydadEyiGD+ea+xvDqt7J0ijYnqPfg@mail.gmail.com>
	<CADK3HHLGRSzbWnbkwixGz2dregiBJJMSBtA9NaUt3eYC8RZ+cA@mail.gmail.com>
	<567FEF32.9010300@archidevsys.co.nz>
	<CADK3HHLD3aAWcEPtUXVCxDrLzENvpAGbqC__dYfzrKEz1wh2VA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@postgresintl.com <mailto:davec@postgresintl.com>
> www.postgresintl.com <http://www.postgresintl.com;
>
> On 27 December 2015 at 09:01, Gavin Flower 
> <GavinFlower@archidevsys.co.nz <mailto:GavinFlower@archidevsys.co.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
>
>
>
>



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



view thread (33+ messages)  latest in thread

Message-ID: <567FF2A3.8060003@archidevsys.co.nz>
Permalink:  ../567FF2A3.8060003@archidevsys.co.nz/
Also on:    postgresql.org/message-id/567FF2A3.8060003@archidevsys.co.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: GavinFlower@archidevsys.co.nz, pg@fastcrypt.com, sitnikov.vladimir@gmail.com, markus@headcrashing.eu
  Subject: Re: PgJDBC: code reformat
  In-Reply-To: <567FF2A3.8060003@archidevsys.co.nz>
  References: <CAB=Je-F1PtJ1Dbsswr=oaj2z8KYpZANHW_kLc2y5DuzjpAJqeQ@mail.gmail.com> <062c01d14031$c4f01aa0$4ed04fe0$@eu> <CAB=Je-GTY_09RLYOA9FgoydadEyiGD+ea+xvDqt7J0ijYnqPfg@mail.gmail.com> <CADK3HHLGRSzbWnbkwixGz2dregiBJJMSBtA9NaUt3eYC8RZ+cA@mail.gmail.com> <567FEF32.9010300@archidevsys.co.nz> <CADK3HHLD3aAWcEPtUXVCxDrLzENvpAGbqC__dYfzrKEz1wh2VA@mail.gmail.com> <567FF2A3.8060003@archidevsys.co.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox