Hacker News new | ask | show | jobs
by jeroenhd 439 days ago
Relying on the inherent JavaScript compatibility hack has caused as many problems as it has solved. Plus, the additional of trailing commas made a mess of things once more, forcing developers to let go of the direct compatibility with many versions of JavaScript engines and redirecting them to specialised JSON APIs instead.

The easy solution would be to go the JavaScript route and make commas optional, like JavaScript does with semicolons. You could even introduce vague and easily forgotten rules about commas being inserted between oneliner dictionaries.

I think the question "why" is easily answered, but "why should it still" is more difficult.

2 comments

Making things optional means you'd end up with the csv standard mess on json, let's not!
The easy solution is horrible solution. Pretty much all the projects set semicolons as mandatory for a reason.