Hacker News new | ask | show | jobs
by masklinn 1129 days ago
> You might as well ask what native numeric or boolean support offer over just jamming stuff in a string in an agreed format.

A big difference is that a numeric or a boolean are quite limited datatypes with agreed upon semantics (mostly).

> Others will point out that JS doesn't have a native date/datetime/time type

It does, in fact. And it's absolute shit.

> but JSON is used for a lot more that persisting JS structures at this point.

So what I'm reading here is that you don't need types to be supported natively in order to serialize to JSON.

1 comments

> It does, in fact. And it's absolute shit.

Maybe it is "just us", maybe it is part of the general shitness you point out, maybe it is the lack of literal representation (even VB and relatives had one) other than an ISO8601 string, but dates don't feel native like simpler types, arrays, objects, fictions, …

> So what I'm reading here is that you don't need types to be supported natively in order to serialize to JSON.

Yes. But not absolutely needing something does not mean it isn't (or wouldn't be) exceptionally useful to have.