Re: About SUCCESS/FAILURE

From: Date: Wed, 24 Dec 2014 04:55:02 +0000
Subject: Re: About SUCCESS/FAILURE
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-79903@lists.php.net to get a copy of this message
Hey > On Dec 24, 2014, at 12:49 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote: > > Hi! > >> Hey: >> >> We use SUCCESS/FAILURE as return value in some APIs, but use >> 0/1(false/true) in others. >> >> I'd like to remove SUCCESS/FAILURE at all, use 0/1 instead.. >> >> what do you think? > > I think it would make reading code harder. Why do it - is there any > benefit in it? SUCCESS/FAILURE is a good way to indicate - well, success > and failure. Replacing it with meaningless numbers would make code > harder to read and harder to write without mistakes. I think if(func()) is better, more readeable than if(func() == success) Thanks > -- > Stas Malyshev > smalyshev@gmail.com

« previous php.internals (#79903) next »