Re: Return value on half failure

From: Date: Sat, 21 Jan 2006 19:11:39 +0000
Subject: Re: Return value on half failure
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-2246@lists.php.net to get a copy of this message
I vote for FALSE. If it returns TRUE when it can fill in the variables, I think FALSE is more than appropriate when it can't / doesn't fill them in. -Jeremy On 1/14/06, Christian Weiske <cweiske@cweiske.de> 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 > > > -- --------------------------- Jeremy Johnstone http://www.jeremyjohnstone.com jsjohnst@php.net

« previous php.gtk.dev (#2246) next »