Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61473 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48756 invoked from network); 19 Jul 2012 10:12:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2012 10:12:09 -0000 Authentication-Results: pb1.pair.com header.from=peter@lvp-media.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=peter@lvp-media.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lvp-media.com from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: peter@lvp-media.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:47897] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/A4-25752-87DD7005 for ; Thu, 19 Jul 2012 06:12:08 -0400 Received: by vbbfs19 with SMTP id fs19so2130857vbb.29 for ; Thu, 19 Jul 2012 03:12:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=kWfgl5oZHMiUAvcbJ6QRWT/gm3EjvQ7xTAa9aSLQp1k=; b=EYwIa3+AoEyCuETNAQsYPBeJ9eiyWihrrn454m1ZPwDXqnPZmbmHdBfYNy0ghcJ0E1 QDXZb+hfxHVZPRofQHrQZFM5s9Jm5exZkewXuV5rZuKG9wIehvkOpkw2SVhxvlsN33oz jPO0hqHng+lQKx8WBKcpN2pKNY3PlBL4MXb55vR+ilCShah07U2cWj1HuYe2Wldz6+2t muDSGoVb7s+apnjdLj5BKrrexSupbqoXJdhyHXAQ6kRL1dkVdKMaMvJaxsnBYMBYUlMM NUmWsb9VajUypIWhnq2nr8mEG9xx+V40qz5yUjSjfZVUzV/LpLN9xp8qFlxD7XrOIeau k7Rg== MIME-Version: 1.0 Received: by 10.52.22.33 with SMTP id a1mr506995vdf.104.1342692718269; Thu, 19 Jul 2012 03:11:58 -0700 (PDT) Received: by 10.52.185.97 with HTTP; Thu, 19 Jul 2012 03:11:58 -0700 (PDT) In-Reply-To: References: <5007D707.2070100@hoa-project.net> <095CAA408DA94AFB9E75C12877A9043D@charliesomerville.com> Date: Thu, 19 Jul 2012 11:11:58 +0100 Message-ID: To: Rafael Dohms Cc: Charlie Somerville , ivan.enderlin@hoa-project.net, internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf3079bdb083d33304c52c02b2 X-Gm-Message-State: ALoCoQmOxoLJVvdBCyNa7dX6DZxuDG+qdASWbX0HWGyjXSAfdX9+K3IyA30kmdrJ5gwfkUDB1w69 Subject: Re: [PHP-DEV] Make try/catch brackets optinal From: peter@lvp-media.com (Peter Beverloo) --20cf3079bdb083d33304c52c02b2 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Jul 19, 2012 at 11:06 AM, Rafael Dohms wrote: > On Thu, Jul 19, 2012 at 12:03 PM, Charlie Somerville < > charlie@charliesomerville.com> 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 > --20cf3079bdb083d33304c52c02b2--