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


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to