Discussion

Ask HN: Did JSON array order used to be a problem?

Now-a-days everyone seems to rely on json that sends ["a","b","c"] over the wire will be parsed and stay in that order.

But years ago I remember developers telling me that certain languages json parsing languages implemented arrays differently so you could never rely on the order and had to do stuff like:

[{"a", "sort": 1},{"b", "sort": 2}, {"c", "sort": 3}]

because the client parsing that might end up with:

[{"c", "sort": 3},{"a", "sort": 1},{"b", "sort": 2}]

and then you'd have to re-sort it yourself. Was this a myth? Did old json parsers really have this problem?

1 points andrewfromx 3 years ago 3 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton