Re: Exception misinformation

From: Date: Wed, 07 Jul 2004 08:41:53 +0000
Subject: Re: Exception misinformation
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31698@lists.php.net to get a copy of this message
Justin Patrin wrote:
I still wonder about this, though, as many experienced coders say that Exceptions shouldn't be used for code flow handling.
Using exceptions means using exceptions as a straight forward goto. For example you call a method login() which checks the credentials of the user. Now you could throw an exception if the user is not logged in to send him to a different part of your code. Hmm maybe someone else can come up with an even clearer example. But a login method not being able to log someone in is usually not an error and certainly not an exception thing. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#31698) next »