questions on nullability

Lars T Hansen lth at opera.com
Thu Jun 15 14:05:21 PDT 2006


On Thu, 15 Jun 2006 21:31:58 +0200, P T Withington <ptw at openlaszlo.org> wrote:

>> From: Lars T Hansen <lth at opera.com>
>> Date: 15 June 2006 05:26:57 EDT
> [...]
>> The entire reason that the class definition can be annotated is to
>> make it easier for the programmer not to have to worry about null when
>> using classes for which a null value does not make sense.
>
> Hi Lars,
>
> Just curious why the default is to permit null.  Seems to me that it
> is more common for it _not_ to make sense for a type to include the
> null value.  Is it just that that would be too great a departure from
> Javascript 1?
>
> [Just getting up to speed on this project, great to see you on it!]

Hi Tucker,

backwards compatibility is probably constraining us here, though classes
are new in 4th Edition so it's possible that non-nullable could be the
default for class instances.  In practice I suspect it may be confusing,
and I also suspect that most object structures are recursive in some way
and will want nullable types.  But I don't recall it being discussed.

--lars



More information about the Es4-discuss mailing list