Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61637 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26976 invoked from network); 23 Jul 2012 04:03:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2012 04:03:45 -0000 Authentication-Results: pb1.pair.com header.from=alex.aulbach@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=alex.aulbach@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: alex.aulbach@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:63494] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/05-20357-F1DCC005 for ; Mon, 23 Jul 2012 00:03:45 -0400 Received: by pbbrp12 with SMTP id rp12so10971980pbb.29 for ; Sun, 22 Jul 2012 21:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=T1HMtzjsLstjoDVEZBAfjO18z0eFDoUTaVjd94XrqQA=; b=ZAlC1k7Sylb8CsjZxkU0l8GEeWdrV8qaXJGi5YNtQMLquTAMDIWCdAisVrlbVYa+Va /Eh6IlKFh3CyUQdC83USPQVujqX7P8xpHKRrWsgRkctaU9w68cSISt2YrkSWCE1mjPQJ /ZZDeh2ruujk4QvxIWyHzJdklWKNLph/Wp2P+Ymc40v50fC5zkVvV/twicgfWPohipe9 TLt/hHOEqwVbOKnU7vgJI9MQF7FMosaWDEvr9fotJA0sHdKqdeyVdMd2kGB704/qE1Uc 4EomCw1Q5kSDIKMZO6bT8+QNAA9+IK5TnhP23aoLbNYVtANbhf5ziJLaKJ8QmxEGfeJW LETA== MIME-Version: 1.0 Received: by 10.68.226.38 with SMTP id rp6mr31727548pbc.90.1343016219678; Sun, 22 Jul 2012 21:03:39 -0700 (PDT) Received: by 10.68.31.7 with HTTP; Sun, 22 Jul 2012 21:03:39 -0700 (PDT) In-Reply-To: <5009669D.6030807@hoa-project.net> References: <5007D707.2070100@hoa-project.net> <5009669D.6030807@hoa-project.net> Date: Mon, 23 Jul 2012 06:03:39 +0200 Message-ID: To: ivan.enderlin@hoa-project.net Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Make try/catch brackets optinal From: alex.aulbach@gmail.com (Alex Aulbach) 2012/7/20 Ivan Enderlin @ Hoa : > On 20/07/12 15:32, Alex Aulbach wrote: >> If you use try/catch that much, that you begin to think about the >> syntax, you have an architecture- or design-problem. > > Not sure about that. First, it was an example. Second, it happens more often > than you think. For example, if you're writing a dispatcher (i.e. redirect > some data to some callables), you will want to catch exception as early as > possible. And you misunderstood me: My first thought of removing bracelets was, that someone could need this, because he has hundreds of try/catch-blocks and just want to spare some typing. My thinking is: If someone needs that much try/catch that he begins to think about syntax, he has definitely another problem (architecture/design). >This is not an architecture- or design-issue, this happens > sometimes when you code. It's always so, but it's not a reason for another syntax. :) > And I would like to point that this is not the topic. The topic is > consistency in PHP syntax (restricted to control structures and > brackets/braces). No, that's exactly the point. :) The reason why we have different syntaxes is, that it was introduced in PHP/FI, about 16 yreas ago. I cannot remember the exact timings, but Rasmus experimented a lot with the syntax and everybody was glad, when the C-syntax has been implemented - but the old syntax-stuff remained and was quite buggy and very obfuscating. This was fixed with PHP3. That's why we have syntaxes without bracelets, everybody liked it, because we could say "haha, you perl-guys, you C-junkies, we've more ways to program an if". That's about 16 (?) year ago and perhaps I mixed it a lttle bit up. But nowadays it's no question, that brackets are good. But at that time continental-European programmers tend not using bracelets, because they are so difficult to type. :) In other words: You want to introduce something, which we are glad not to need anymore. :) -- Alex Aulbach