Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61566 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46807 invoked from network); 20 Jul 2012 14:09:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 14:09:39 -0000 Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:59088] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/A3-18983-1A669005 for ; Fri, 20 Jul 2012 10:09:38 -0400 Received: from Hwhost2.local (241-68.77-83.cust.bluewin.ch [83.77.68.241]) by host1.trois-doubles.net (Postfix) with ESMTPA id 543A52079FA for ; Fri, 20 Jul 2012 16:09:34 +0200 (CEST) Message-ID: <5009669D.6030807@hoa-project.net> Date: Fri, 20 Jul 2012 16:09:33 +0200 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120715 Thunderbird/15.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: <5007D707.2070100@hoa-project.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Make try/catch brackets optinal From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") On 20/07/12 15:32, Alex Aulbach wrote: > Hi Ivan, > >> try >> throw new Exception('foobar'); >> catch(Exception $e) >> var_dump($e->getMessage()); > 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. This is not an architecture- or design-issue, this happens sometimes when you code. 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). Best regards. -- Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/