it's clean code as long as you can read it without having to do much trouble, and you have written it the shortest way possible with still enough extra stuff around to make other ppl understand it...
so, I would say -> yeah, it's clean :)
- Tularis
Beau Hartshorne wrote:
Hi, I'm curious if it's bad coding style for a function to return a value on success, or simply "false" on fail. Here's what I mean: <?phpfunction foo($number) { if (is_numeric($number)) { return $number . ' is a number.'; } else { return false; } } if ($string = foo(1)) { echo $string; } else { echo 'error'; } ?>
Is this ok? Thank you, Beau
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php