Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aDC7U-0008RW-AC for pgsql-jdbc@arkaria.postgresql.org; Sun, 27 Dec 2015 14:16:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aDC7T-0007qM-Q8 for pgsql-jdbc@arkaria.postgresql.org; Sun, 27 Dec 2015 14:16:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aDC7T-0007px-4F for pgsql-jdbc@postgresql.org; Sun, 27 Dec 2015 14:16:23 +0000 Received: from mbx.knossos.net.nz ([202.160.48.10]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aDC7N-0007Ox-IS for pgsql-jdbc@postgresql.org; Sun, 27 Dec 2015 14:16:21 +0000 Received: from [10.1.1.3] (dynamic-cpe-pool.orcon.net.nz [121.98.103.53] (may be forged)) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id tBREG3lq006047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 28 Dec 2015 03:16:04 +1300 Subject: Re: PgJDBC: code reformat To: Dave Cramer References: <062c01d14031$c4f01aa0$4ed04fe0$@eu> <567FEF32.9010300@archidevsys.co.nz> Cc: Vladimir Sitnikov , Markus KARG , List From: Gavin Flower Organization: ArchiDevSys Message-ID: <567FF2A3.8060003@archidevsys.co.nz> Date: Mon, 28 Dec 2015 03:16:03 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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 > www.postgresintl.com > > On 27 December 2015 at 09:01, Gavin Flower > > > 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