3 ms·
I kinda agree, but I also think then you want unquoted keys {name: "value"} And then maybe 123_456 syntax It's a slippery slope ... pretty soon it's hard
by chubot 3y ago
I kinda agree, but I also think then you want unquoted keys
{name: "value"}
And then maybe 123_456 syntax
It's a slippery slope ... pretty soon it's hard to write a JSON parser, and there are more bugs
The trailing comma one is trivial, I'll grant that
- marcosdumay 3y agoTrailing commas a very highly impactful to the users, and trivial to the language writers. The 123_456 syntax comes close to that, but is much less impactful. None of those will make the language hard to parse.
- Spivak 3y agoAs much as I think it's annoying I think no trailing commas enforces good coding hygiene and basically forces you to use a real encoder rather than as hoc string manipulations.
- rand_flip_bit 3y agoThis is such a bad take
- Spivak 3y agoCare to like, elaborate? Stopping people from doing brittle stuff like print("{") for elem in list: print('"key": "value",') print("}") seems like immediate worth.
- alwaysbeconsing 3y agoThat's not a very big hurdle to overcome, though: print("{") contents = "" for elem in list: contents += '"key": "value",' print(contents[:-1]) print("}")
- marcosdumay 3y agoYou are talking about data transfer encoding. Configuration languages are a completely different beast.