Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70554 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40373 invoked from network); 9 Dec 2013 16:06:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2013 16:06:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=pjsturgeon@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pjsturgeon@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.47 as permitted sender) X-PHP-List-Original-Sender: pjsturgeon@gmail.com X-Host-Fingerprint: 209.85.215.47 mail-la0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:41179] helo=mail-la0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/00-40251-F8AE5A25 for ; Mon, 09 Dec 2013 11:06:40 -0500 Received: by mail-la0-f47.google.com with SMTP id ep20so1723593lab.20 for ; Mon, 09 Dec 2013 08:06:36 -0800 (PST) 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=X2w6MJoxxfhj9E9S0ft7Uniqky62/fes4QuI81G3E64=; b=yKo3iBBVx5EcUT+QcDNrG1C/ose5zhq/RMBd4kXjiuCw2xiupzvNuWyYwGkoRDhb8K HRFOVE87td0tbpOQq70Jo2L57tQZCImRxinqaLRtw/E3vX/xGMhjoUpip7Z6SurabPcx Sb3CQc5igsMdjzmfzeif1WgQL8hBWMgcp1E+Ab/atbMaEM0GdTgi3PGhTpdzlNXV+zkK ru9SRgGKXU05j1oboCb/5D0Rht6StQaHMnxS09laQioseuCYMIu6U6jKKP1ibi/ZUIPk 65o49e68zodiovDexAkKECrL2vGOFprOPtmjJND7Ds2b2pm6iQjYqvDVkDj2D56SvNyy e+sg== MIME-Version: 1.0 X-Received: by 10.152.4.162 with SMTP id l2mr1673336lal.75.1386605196332; Mon, 09 Dec 2013 08:06:36 -0800 (PST) Received: by 10.114.64.131 with HTTP; Mon, 9 Dec 2013 08:06:36 -0800 (PST) In-Reply-To: References: Date: Mon, 9 Dec 2013 11:06:36 -0500 Message-ID: To: Zeev Suraski Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [VOTE] Allowing use of exceptions in the engine From: pjsturgeon@gmail.com (Philip Sturgeon) On Mon, Dec 9, 2013 at 10:58 AM, Zeev Suraski wrote: >> > OK, got you. Not using exceptions in the engine was also a design >> > decision (so that we don't force OO concepts on non-OO people) - need >> > to think if it still makes sense and get back to the vote. >> > >> > Thanks! >> > >> > Zeev >> >> I think it is fair to say there is a big difference between "forcing OO > concepts >> on non-OO people" and which is what is being proposed >> here: "this is an object which you can use if you'd like to find out > what is >> happening with this exception." >> >> No PHP developer is going to get away with not using any objects ever >> regardless of their preferred design approach, so offering them > exception >> objects is not going to frighten anyone off. > > While I disagree that all PHP developers would have to use objects (you > can live a full healthy procedural life in PHP) - regardless, exceptions > and their jargon is a much more advanced OO concept than just using plain > objects. Throwing, catching, propagation rules, try/catch/finally - those > all come hand in hand with exceptions. We've made a conscious decision > not to force this on users back when we introduced exceptions, and keep > the engine use errors only (which can be converted to exceptions easily > enough using error handlers). > > Note that I think that this part is debatable - I'm a lot more worried on > the feedback Dmitry provided earlier today (although I admit I'm not crazy > of just keeping things the way they, and letting those who are interested > in exceptions convert errors to exceptions on their own). > > Zeev Right, you can absolutely live a full and healthy life in PHP using entirely procedural code (things like the dual interfaces for MySQLi ensure that) but I really really do not see "here is an object, try/catch/finally or EngineException" as "forcing OO concepts on non-OO people" because it isn't. The user does not need to worry about propogation rules unless they start writing their own exceptions and try/catch/finally is not inherently OOP. Even if it was the average procedural user is just going to see the difference of "Fatal Error you code is screwed" changing to "Uncaught Engine Exception your code is screwed" if they don't want to bother catching anything, which they wouldn't if they didnt want to use try/catch... so the whole thing is a bit of a non-argument. I know it is not your main concern, but I really don't want this argument being used as one against this RFC in general.