'void' as a value

Rick Waldron waldron.rick at gmail.com
Mon Sep 9 10:41:13 PDT 2013


On Mon, Sep 9, 2013 at 5:41 AM, Claude Pache <claude.pache at gmail.com> wrote:

>
> Le 9 sept. 2013 à 10:35, David Bruant <bruant.d at gmail.com> a écrit :
>
> > Le 08/09/2013 21:39, Brendan Eich a écrit :
> >> In no case does anyone that I've spoken to, on TC39 or anywhere else
> around this planet, want *yet another* bottom type and singleton value a la
> null and undefined. No one. Those who speak Spanish and nearby languages
> tend to say "¡Basta!" -- I'm not kidding :-|.
> > Two values are already arguably (!) a regrettable feature
> https://github.com/DavidBruant/ECMAScript-regrets/issues/26
> >
> > David
>
> For me, it is a excellent feature, if we get the correct semantic:
> * `undefined` means "no value", or "nothing";
> * `null` means "empty value", or (well) "null".
>

This was exactly my response, and I'll add that the only regrettable aspect
is the typeof null issue.


> Practical usefulness:
> * ES5: JSON stringification of object: `null` means `null`, and
> `undefined` means "no value, don't include the corresponding key".
> * ES6: default values in function arguments (and maybe destructuring
> assignment?): `null` means `null`, and `undefined` means "no value, take
> the default".
>

Yep. I think that in the world of ES6 we'll see developers learning and
respecting the difference between null and undefined.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130909/5d48b13e/attachment-0001.html>


More information about the es-discuss mailing list