Re: About SUCCESS/FAILURE
| From: | Xinchen Hui | Date: | Wed, 24 Dec 2014 04:59:26 +0000 |
| Subject: | Re: About SUCCESS/FAILURE | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79905@lists.php.net to get a copy of this message | ||
> On Dec 24, 2014, at 12:55 PM, Xinchen Hui <laruence@gmail.com> wrote:
>
> 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
yes, to be consistent
We have functions all return int
But some is them use success (0) some of them use bool true(1)
That will lead to hard to write codes
Thanks
>> 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