Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79905 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19115 invoked from network); 24 Dec 2014 04:59:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Dec 2014 04:59:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.54 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.54 mail-pa0-f54.google.com Received: from [209.85.220.54] ([209.85.220.54:48212] helo=mail-pa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/61-10609-5384A945 for ; Tue, 23 Dec 2014 23:59:34 -0500 Received: by mail-pa0-f54.google.com with SMTP id fb1so9353630pad.13 for ; Tue, 23 Dec 2014 20:59:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gcIgf/9ObHR3nD4dERznDDW0c/0YKHY7haLOfijK7Ck=; b=ZsCe8J4ENvredU/ImWemsrnHTazw1Q234yftXoCnfM0zuleBqjdLy3pzOyH7K2ow3l J7+YObnlvwJ8LmY8I1dMJ5H7MzXxRdT5IIu2P7y2n3CT76oXpolUUrok+LcT54M71SC9 58d5Sra8NsGJX30KgP5y2JPbkGI+iQkWCqWwgZgkLDUpQfHWzFK1qZtOS1jBfiAACuR5 k9lZyGnx/904yaVUIloW8YrNVzxiVoKrrAV7FgnzZ6CkqFm2Npu8k9kS6YyZVyWNaw5F gkZTqoJ9hEZiHCvxCpR3nPSbdP0fYSuuLvS2X4+PV3rVlWJYEzBH3KYfBRC1C2EzpGyQ Y3HA== X-Received: by 10.70.129.106 with SMTP id nv10mr49512450pdb.7.1419397171511; Tue, 23 Dec 2014 20:59:31 -0800 (PST) Received: from [10.168.131.234] ([117.136.38.168]) by mx.google.com with ESMTPSA id ws4sm21462457pbc.53.2014.12.23.20.59.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Dec 2014 20:59:29 -0800 (PST) Content-Type: text/plain; charset=gb2312 Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (12B440) In-Reply-To: <50C312FD-B626-4CDF-B6E5-7EB625C28214@gmail.com> Date: Wed, 24 Dec 2014 12:59:26 +0800 Cc: Xinchen Hui , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <46A21155-B3F2-4D56-91F1-C3F7ED1747B5@gmail.com> References: <549A45BD.9050304@gmail.com> <50C312FD-B626-4CDF-B6E5-7EB625C28214@gmail.com> To: Stanislav Malyshev Subject: Re: [PHP-DEV] About SUCCESS/FAILURE From: laruence@gmail.com (Xinchen Hui) > On Dec 24, 2014, at 12:55 PM, Xinchen Hui wrote: >=20 > Hey >=20 >=20 >> On Dec 24, 2014, at 12:49 PM, Stanislav Malyshev wr= ote: >>=20 >> Hi! >>=20 >>> Hey: >>>=20 >>> We use SUCCESS/FAILURE as return value in some APIs, but use >>> 0/1(false/true) in others. >>>=20 >>> I'd like to remove SUCCESS/FAILURE at all, use 0/1 instead.. >>>=20 >>> what do you think? >>=20 >> I think it would make reading code harder. Why do it - is there any >> benefit in it? SUCCESS/FAILURE is a yes=A3=AC 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() =3D=3D success= ) >=20 > Thanks >> --=20 >> Stas Malyshev >> smalyshev@gmail.com