Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85865 invoked from network); 19 Mar 2016 05:20:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2016 05:20:58 -0000 Authentication-Results: pb1.pair.com header.from=walterp@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=walterp@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.181 as permitted sender) X-PHP-List-Original-Sender: walterp@gmail.com X-Host-Fingerprint: 209.85.161.181 mail-yw0-f181.google.com Received: from [209.85.161.181] ([209.85.161.181:35868] helo=mail-yw0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/C1-03097-7B1ECE65 for ; Sat, 19 Mar 2016 00:20:55 -0500 Received: by mail-yw0-f181.google.com with SMTP id g3so163063282ywa.3 for ; Fri, 18 Mar 2016 22:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=de8yUkNsAgiGLlPDfSpRX669qG3AxCW7WcbQY6R+5no=; b=pjtqtMXhadH7TvdJOYld1SVJDSjuSVNOjP8Cdjh12/e1obFSid3AJcvxA1gXdHkI3G DEfP1GK02I/7KSj5bdc32jGkGpBw79sdMEsx+eDpaULKXaXAdsKcVbWFt7wt/+vpLucR DZ2OksBf7k+onOWS0lfs38WLcudZ6jJlFuupHmb83+NYOIYfDU+XP7dMyomkvaJpzZ0I bYZpaKKvRCXZmDBPtsgsGlFZWnc8Oz1GvMu14cHXxLguWQoZNt0WXOXq0pH7BeFG/Hzy vL2bUtv9C5Z2K89mgeWijTTPa2ziBvl3Q0Z8uXs4ZmTO4jSawH/z1jbt/fDdNtGWwhrI zpRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=de8yUkNsAgiGLlPDfSpRX669qG3AxCW7WcbQY6R+5no=; b=WzVTTZWSU2zpME8O6nLOGDpJrOLq1bGOJX8PrTKz5Uk7s+pKW1Yn0JZ78GuLgqpS2I vKwnDAa5Y5r1vdGL60zGNpHGukfX+1sTcYsZefi0y4gJeHGl3j7ANpBTxqp9nj/wfJo1 C6n8paGrHfbDM1rRvk2MkDPUkccv0t8XTse0iYFZ+VBZqlAXbMsU0RJhvo3xhXjJgRlE 3uV6eKy0bwZlO9sHkny+OKueoxzeEAaxNZn+v80f/KSdXRkTWjXdZeK59VnlZGlSxqh+ Cm866asrzZ+AGXye0nx17SLVOCTqNFQNUdewFSz7/K5Ind8Uxzuop6rg1AGLBDdH3/Ti 0jrQ== X-Gm-Message-State: AD7BkJJNQ+kYuyckKfKB4Z0iX+nDXBWEXCrp7KCPP3wAZeDZYr8arTsEMhTvhnbn1nM2wQS+ghusyFeD0sk9hA== MIME-Version: 1.0 X-Received: by 10.37.109.68 with SMTP id i65mr9011862ybc.91.1458364852407; Fri, 18 Mar 2016 22:20:52 -0700 (PDT) Received: by 10.83.33.19 with HTTP; Fri, 18 Mar 2016 22:20:52 -0700 (PDT) In-Reply-To: <56ECCFCB.6090105@garfieldtech.com> References: <56EC69EF.1090003@fleshgrinder.com> <56ECCFCB.6090105@garfieldtech.com> Date: Fri, 18 Mar 2016 22:20:52 -0700 Message-ID: To: Larry Garfield , PHP Internals Content-Type: multipart/alternative; boundary=001a11414ee0fb210e052e6006a2 Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: walterp@gmail.com (Walter Parker) --001a11414ee0fb210e052e6006a2 Content-Type: text/plain; charset=UTF-8 On Friday, March 18, 2016, Larry Garfield wrote: > On 03/18/2016 03:49 PM, Fleshgrinder wrote: > >> First a general note on the complete nullability first: It is not up to >> us as language designers to decide whether it is good practice to use >> nullable properties or not. It is supported by many systems since ages >> (e.g. SQL where nullable fields are also not recommended but heck they >> are useful) and it is common practice in PHP. Hence, there must be >> support for it. That does not mean that it is endorsed in any way by us, >> it is just there for people who need it for the same reasons they needed >> it in the past 20 or so years. >> > > At the risk of a small tangent, I cannot agree at all here. The whole > point of language design is to make decisions regarding what "good > practices" to encourage, enforce, or disallow. Some languages disallow > mutable variables (despite them being useful). Some languages disallow > global variables (despite them being occasionally useful). Some languages > disallow NULLs (despite them having use cases in many languages). Those > are all viable and reasonable decisions for a language designer to make in > various circumstances; to say that it's "not up to us as language > designers" to make such decisions is to abdicate our responsibility as > language designers. > > There may well be good arguments to allow property nullability. There's > also good arguments against it. We'll decide one way or another. But "we > shouldn't take a position at all" is worse than taking a position, because > that implicitly does take a position (allowing it), while pretending that > we didn't. Basically it means lying to ourselves about it, which is never > the right answer. > > Design is about making deliberate, informed decisions. Let's make a > deliberate, informed decision. > > To help with the informed part, can anyone speak to how other languages > handle null-typed properties? I believe Java allows everything to be NULL > (which sucks), but I'm not sure about other modern languages. Can anyone > speak to that? (I'd be particularly interested in Python, Go, and Rust, > but any language you can speak to definitively would be valuable to know > about. Javascript and Ruby are, AFAIK, insufficiently typed for the > question to apply.) > > --Larry Garfield > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > C A Horte, the famous computer scientist, calls the introduction of nulls into his type system (like how Java did it decades later) to be his Billion dollar mistake. He did it for the mathematical elegance and didn't foresee all of the null errors that would come. Nulls sound great in theory, in practice they can be trouble. Walter -- The greatest dangers to liberty lurk in insidious encroachment by men of zeal, well-meaning but without understanding. -- Justice Louis D. Brandeis --001a11414ee0fb210e052e6006a2--