Re: Return value on half failure
| From: | Andrei Zmievski | Date: | Mon, 23 Jan 2006 18:14:51 +0000 |
| Subject: | Re: Return value on half failure | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2283@lists.php.net to get a copy of this message | ||
I would return null or FALSE. In general, we have been returning null as the error value (especially for invalid parameters), but we should standardize on something. It doesn't really matter, but I have a slight preference for null since there may be methods that are supposed to return boolean values and in those you cannot use FALSE for error value.
-Andrei
On Jan 14, 2006, at 2:08 PM, Christian Weiske wrote:
Andrei (and others with a voice), What return value should methods have that have a "half" failure, e.g. gdk_event_get_coords? It returns true and fills two double variables in case the event had some coords associated, and returns false if there were no coords for the event. PyGtk returns an empty array in the latter case, but it would be more php-ish to return FALSE instead of an array. On the other side it's no "real" error. I still vote for returning false, but want to hear your opinion. -- Regards/MfG, Christian Weiske