Re: Re: Long Live GOTO
| From: | Marco Behnke | Date: | Mon, 06 Feb 2012 20:44:45 +0000 |
| Subject: | Re: Re: Long Live GOTO | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316493@lists.php.net to get a copy of this message | ||
Am 06.02.12 17:23, schrieb Alain Williams:
> However: a few GOTOs can make things clearer. Think of a function that
> can fail in several different places (eg data validation, ...). But it
> is reading a file which needs to be closed before the function
> returns. I have seen code where some $IsError variable is tested in
> many places to see if things should be done. That is just as bad as
> lots of GOTO -- often when having to write something like that I will
> have a GOTO (in
Good code uses Exceptions and try catch for that kind of scenarios.
--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3
Tel.: 0174 / 9722336
e-Mail: marco@behnke.biz
Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal
http://www.behnke.biz
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc