Re: Continued try blocks

From: Date: Tue, 07 May 2013 17:08:24 +0000
Subject: Re: Continued try blocks
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-67338@lists.php.net to get a copy of this message
The feature exists in Python: http://stackoverflow.com/questions/574730/python-how-to-ignore-an-exception-and-proceed, in Ruby: http://stackoverflow.com/questions/5089802/which-is-the-shortest-way-to-silently-ignore-a-ruby-exception. Just saying. On Wed, May 1, 2013 at 4:46 AM, Patrick ALLAERT <patrickallaert@php.net>wrote: > 2013/4/30 Pierre Joye <pierre.php@gmail.com>: > > hi, > > > > On Tue, Apr 30, 2013 at 7:54 PM, Stas Malyshev <smalyshev@sugarcrm.com> > wrote: > > > >>> You may have a lib/object/chunk of code which raises exceptions, > because > >>> its developer thought some error is not recoverable; but when you use > >>> it, you don't want to break your program's execution. > >> > >> That's why you have try/catch. > > > > Exactly, I cannot agree more here. > > > > This proposal brings yet again exceptions for control flow, which is > > really not what they are designed for (no matter the language, or > > almost all languages). An exception can be handled and the program can > > continue? Catch it, any other tricks bring control flow using > > exception and that's really a bad idea. > > I'm quite opposed to changing try/catch flow with this additions for > the same reasons that Stas and Pierre mentioned. > Especially since this can perfectly be achieved without it and a few > more ifs/whiles/gotos. > There no need to have a gentle/nice-to-have syntax to handle the cases > of libraries abusing exceptions. > > Cheers, > Patrick > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#67338) next »