Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64432 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52007 invoked from network); 26 Dec 2012 00:04:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Dec 2012 00:04:00 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.143 smtp143.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.143] ([67.192.241.143:56702] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/40-47159-DEE3AD05 for ; Tue, 25 Dec 2012 19:03:58 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp4.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 349263A02AE; Tue, 25 Dec 2012 19:03:55 -0500 (EST) X-Virus-Scanned: OK Received: by smtp4.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id A92C23A02AA; Tue, 25 Dec 2012 19:03:54 -0500 (EST) Message-ID: <50DA3EE9.8040404@sugarcrm.com> Date: Tue, 25 Dec 2012 16:03:53 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Tjerk Anne Meesters CC: Nikita Popov , PHP internals References: <50CF969D.8090707@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Adding Generator::throw() From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I've been hearing this argument from time to time and I don't understand > it; aren't exceptions created with the sole purpose of (error) flow control? No. Exceptions are meant for something that "should never happen". I.e., if your application reads its config files and they are not there, or connects to the database and database is not there - that's an exception. If you just have something like "user clicked this button and not that button" - it should not be an exception. Thus, exceptions should be used to handle cases which are not part of the normal program flow control. That said, it does not look like in this case (generators) it is being used wrongly, my initial impression was based on the lack of information, and turns out to be wrong. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227