Personally, I prefer duplicate keys to be eaten by the parser but I can see how it’d be beneficial to prevent them.
Personally, I prefer duplicate keys to be eaten by the parser but I can see how it’d be beneficial to prevent them.
Yeah, I remember when I was trying to parse XML into some lua tables and it forever stumped me how to represent something like
<thing important_param=10 other_param="abracadabra"> stuff </thing>
You just have to have different ways to turn different tags into stuff in your program and that’s a huge amount of overhead to think about when all I want is a hash map and maybe an array.
It’s inconsistent and annoying. Expressive, yes. Gets it’s job done, yes. Absolute nightmare of a spec, YES.
The fact that JSON is a subset of YAML should tell you everything about how bloated the spec is. And of course there’s the “no” funny things.
Personally, my favourite way to write configs was using lua (because it was already part of the project so why not), but JSON does fine.
Genuinely, why? Personally, I’m happy to eat basically same meals for a few days before they get boring, and you can vary your sandwiches a lot of you so desire.
Man, the variable scoping thing is insidious. It will never not be weird to me that
if
s and loops don’t actually create a new scope.And then you try to do a closure and it tells you you didn’t import anything yet.