[Koha-patches] [Bug 5379] Pull Request
Colin Campbell
colin.campbell at ptfs-europe.com
Thu Nov 11 18:03:15 CET 2010
On 11/11/10 16:44, Galen Charlton wrote:
> An undefined value is a clear indication that something went wrong; 0
> in this context would be just another magic value. Magic values are
> to be avoided, even if the magic value in question is 0.
>
> Consider
>
> $borrowernum = AddMember(...);
>
To reinforce the point 0 could be passed back as valid data. (You can
make mysql start its serial assignments from 0. Why you would want to I
dunno ). Using undef to return an error leads to the route of least
surprise and identifying and rectifying any code that is trying to use
that as a value is usually straightforward.
Colin
--
Colin Campbell
Chief Software Engineer,
PTFS Europe Limited
Content Management and Library Solutions
+44 (0) 208 366 1295 (phone)
+44 (0) 7759 633626 (mobile)
colin.campbell at ptfs-europe.com
skype: colin_campbell2
http://www.ptfs-europe.com
More information about the Koha-patches
mailing list