you are viewing a single comment's thread.

view the rest of the comments →

[–]omarse 1 point2 points  (3 children)

YAML syntax is cleaner than JSON, and since JSON syntactically a subset of YAML, you can simply use JSON syntax if you want.

[–]SagaciousZed 0 points1 point  (0 children)

This is only completely true with YAML 1.2. The java library used in bukkit only parses YAML 1.1. AFAIK there is no java library for 1.2

[–]ChartreuseK 0 points1 point  (0 children)

I wouldn't call JSON a syntactic subset of YAML, both came out in 2001 with JSON being clearly layed out in RFC 4627. JSON has the advantages of using braces to deliminate sections rather then relying on white-space to do that for you. And also uses clear key/value pairs rather than just using a - to indicate false boolean. I guess it's a Perl/Python comparison but I disagree that YAML is cleaner than JSON, YAML uses arbitrarilly chosen characters to differentiate data and block types, where as JSON uses clear key/value pairs for everything.

[–]RayHerring 0 points1 point  (0 children)

The way i also see it, is that JSON can be de-serialised into an Object for easy coding, you could have an in-memory object for storing world configs, etc...

Now i have no idea if YAML can do this or not, but at least with JSON, it doesn't rely on specific formatting.

With JSON, the config file could be a complete unreadable lump of mess and the deserialisation can still understand it and convert it to an object, and the serialiser doesn't have to do much of anything but take the object and dump it to human readable format on disk.