- Arrays allow trailing commas!
- Comments! (From a JSON perspective, that's huge!)
- Dates are UTC!
- Simple syntax, no semicolon / commas, no need to check for matching braces!
- No way to go back to the global hash. Once you go down one level, can't go back up!
inGlobal = true
[keygroup]
inKeyGroup = true
# Here, you can't add a key to the global hash!
-
You can't have mixed data in arrays unless they're both one level deep!
So, it feels like arrays are typed, except that empty arrays are not.
key = [ [1], ["foo"], [] ]
- You can't have hashes inside arrays!
# That really should be an array.
[dependancy1]
groupId = "com.google.api-client"
artifactId = "google-api-client"
version = "1.13.2-beta"
[dependancy2]
groupId = "com.google.api-client"
artifactId = "google-api-client-servlet"
version = "1.13.1-beta"
- The specification is lacking!
- A document in UTF-16 / Windows 1252 must change encoding to UTF-8 in each string!
- What happens when the keygroup is the empty string?
- Lots of (informally-specified) things you can't encode: keys with
=
in them, keygroups with]
in them… (The current spec allows=
in keys by not forbidding it.) Which special characters are allowed in keys anyway?
Alternative: the Settings File Format.
It isn't quite true that all keys for a particular group are located in the same place.
For instance:
The idea that static languages would have a hard time with heterogeneous arrays ignores the fact that static languages usually include the type of the content in the type of the array, effectively making things like
[[1], ["1"]]
impossible to map to built-in arrays, unless I'm about to learn something awesome.In that sense, empty arrays are indeed untyped: their generic type parameter cannot be inferred. We don't know the type of its content.
Indeed, yay for tuples! Although I cannot see myself using homogeneous arrays knowing that tuples are there, which makes the homogeneous argument harder to maintain. Choice is nice nonetheless.
As for having mixed encodings, what do you expect text editors to show?
I made a lengthier rant here, about the unfortunate history of configuration formats.
Anyway, if my rants can be of help, I'm glad!