Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92416 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41824 invoked from network); 18 Apr 2016 16:57:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2016 16:57:55 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.26 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.26 out2-smtp.messagingengine.com Received: from [66.111.4.26] ([66.111.4.26:60617] helo=out2-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/99-11975-31215175 for ; Mon, 18 Apr 2016 12:57:55 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A67EF20482 for ; Mon, 18 Apr 2016 12:57:52 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 18 Apr 2016 12:57:52 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=yoDppcGguvqYwD2 +CZaN1eYAxus=; b=LD1yAMlvEfYcDcUI0SuY+RribjurJ77dhYs6KXCRwxiM29g EQhlgnZK/z3DgQzQ6siHfMDzkOLZviA4yiyGcIUCpvS2PmIv84sSI7s64GrSdQ2v 5ymYJx4Bzlrda/nPV0L+VZ9UoHyMnD5TY27oBv4q3xXpFpFJUJrWwJ6yaNeo= X-Sasl-enc: gNg37tX9Wk42YE0FIlj6IoGFn0ilO2czRtNFiHYgQCSG 1460998672 Received: from Crells-MacBook-Pro.local (unknown [63.250.249.138]) by mail.messagingengine.com (Postfix) with ESMTPA id 6819BC0001B for ; Mon, 18 Apr 2016 12:57:52 -0400 (EDT) To: internals@lists.php.net References: <57103A46.6040803@garfieldtech.com> <5710BA79.5060108@lsces.co.uk> <57110DC5.8000007@garfieldtech.com> <571338E6.50507@fleshgrinder.com> <57145AF7.7060607@garfieldtech.com> <57149405.2040701@lsces.co.uk> Message-ID: <57151210.7040704@garfieldtech.com> Date: Mon, 18 Apr 2016 11:57:52 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <57149405.2040701@lsces.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Nullable Return Type Declaration From: larry@garfieldtech.com (Larry Garfield) On 4/18/16 3:00 AM, Lester Caine wrote: > On 18/04/16 04:56, Larry Garfield wrote: >> 2) Doesn't make it quite so easy, which hopefully discourages (but does >> not prohibit) its usage. > This implies that using 'null' is wrong ... and is a slippery slope to > then 'disabling' null where some people think it should be removed. If > PHP development is making these sort of decisions it should be clear > that is the intention, not just 'hopefully discourages' things that some > people have no appreciation of the usefulness of! I am not sure what you're implying by "some people have no appreciation of the usefulness of"... I am well aware of NULL's use cases. I am also well aware that the general zeitgeist in the language development community is that they're dangerous; the designer of the first language to have them calls them a "billion dollar mistake", many languages actively avoid having NULL in favor of something deliberately more structured. NULLs are a very common cause of avoidable fatal errors in many languages (including PHP). NULLs are rude to users of your API, as it balloons the error handling code they need to deal with. I am on record and will continue to be on record that null is *usually* wrong. I consider that position entirely justified, as does the academic CS community. I am also now on record suggesting that we use union types to allow type-or-null returns/parameters, which you're welcome to quote me on. :-) Are you comfortable with the compromise position I've proposed? -- --Larry Garfield