develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Using braces on 'if'; Was: Re: Asan help request

Thread Previous | Thread Next
H.Merijn Brand
July 31, 2013 07:27
Re: Using braces on 'if'; Was: Re: Asan help request
Message ID:
On Tue, 30 Jul 2013 21:29:49 -0700, Father Chrysostomos
<> wrote:

> I would prefer that we not have too many rules.  Being able to format code free-style allows for more clarity when things can up vertically:
>     if      (CvROOT(cv))  slab = OpSLAB(CvROOT(cv));
>     else if (CvSTART(cv)) slab = (OPSLAB *)CvSTART(cv);
> Also, I don’t find that the extra verbosity of braces really helps.  In Perl the fact that braces are enforced does not increase verbosity, because we have ‘and’ and ‘or’ for control flow.  Do that in C and you get void warnings galore.
> If you do not feel comfortable omitting the braces, then don’t omit them.  But does that have to apply to those of us who do feel comfortable omitting them?  I omit them all the time, and only once has that resulted in a mistake (which was caught very quickly).

+Inf to that

In code *I* am responsible for, I remove unneeded braces, as they just
take away focus from the code I read. They just act as noise.

H.Merijn Brand   Perl Monger
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About