I understand that in "normal" JS code date literals are kind of not
needed.  As probably in any other programming language where date
values are coming from external sources, e.g. from DB/persistent
storage.

But JS/ES is quite unique in this respect. It's data literals *are*
used as a form of persistence, and  quite a lot. Think of JS derived
syntax constructs like JSON or MongoDB query language.

If tomorrow JSON2 will appear it will come up with its own date
literals. And suddenly you will not be able to use eval() to parse
JSON. I know that eval() ideally should not be used to parse JSON but
nevertheless. I believe that it is beneficial for many reasons for the
language to include transport format (e.g. JSON literals) as part of
base syntax.



On Wed, Oct 9, 2013 at 8:29 AM, Brendan Eich <[email protected]> wrote:
> Andrew Fedoniouk wrote:
>>>
>>> http://wiki.ecmascript.org/doku.php?id=discussion:date_literal_syntax
>>> >
>>> >  http://wiki.ecmascript.org/doku.php?id=proposals:date_literal_syntax
>>> >
>>> >
>>> > https://encrypted.google.com/#q=site:https%3A%2F%2Fmail.mozilla.org%2Fpipermail%2Fes-discuss%2F+%22date+literal%22
>>> >
>>
>>
>> Thanks for links but what is the conclusion?
>
>
> No date literals in JS. Not worth their weight, most Dates are not expressed
> as hardcoded date strings. If you need it, use an ES6 template string.
>
> /be



-- 
Andrew Fedoniouk.

http://terrainformatica.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to