Re: Make try/catch brackets optinal

From: Date: Thu, 19 Jul 2012 10:11:58 +0000
Subject: Re: Make try/catch brackets optinal
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Thu, Jul 19, 2012 at 11:06 AM, Rafael Dohms <[email protected]>wrote:

> On Thu, Jul 19, 2012 at 12:03 PM, Charlie Somerville <
> [email protected]> wrote:
>
> > This has code readability problem written all over it. When maintaining
> it
> > also has problems, like with the bracket-less if's.
> > You would need to add brackets if you add an extra line here, as well as
> > you might get unexpected behaviour of you forget to
> > add brackets in that case.
> >
> > I've often heard people make this argument, but I've never found it to be
> > a real concern in practise.
> >
> > Is this really such a common problem?
> >
>
> I have seen this problem happen, people losing time trying to figure out
> what is wrong only to find
> its a missing bracket.
> As Paul said, this is bug-prone.
>

Other bracket-less blocks allow authors to shoot themselves in the foot
equally so, yet PHP supports these as well. The actual problem here is an
inconsistency in the parser, which I'd consider to be a bug.

Peter


> --
> Rafael Dohms
> PHP Evangelist and Community Leader
> http://www.rafaeldohms.com.br
> http://www.phpsp.org.br
>


Thread (47 messages)

« previous php.internals (#61473) next »