top | item 39652067

(no title)

nocombination | 2 years ago

Generally there is misunderstanding of these markups. JSON came along because the JavaScript people found it convenient and more network-efficient (the irony being it's not really). But a million years later followed the schema-validation logic to back-fill deficiencies.

In my opinion, one should go for XML when writing a portable document format of any variety to allow a vast array of schema validators, linters, and so-forth. This makes writing plugins which target a given schema much more portable and easier to write.

It's kind of ridiculous how many times web folks reinvent the wheel. Seriously, get rid of YAML, TOML, JSON. We already had INI, XML/XPATH/XSD.

There's nothing wrong with XML, people are just lazy and so is JSON. It's the lazy, sloppy cousin of XML which was a well-thought-out standard to fill a deficiency in HTML for data.

Honestly though, we should be using something like this: http://openddl.org/

discuss

order

messe|2 years ago

> Seriously, get rid of YAML, TOML, JSON. We already had INI, XML/XPATH/XSD

I agree with you on YAML/JSON, but isn't TOML more or less INI with more data types and an actual specification?

nocombination|2 years ago

Yeah sorry didn't mean to add TOML in there.

And to be fair, YAML is somewhat clean for what it is. I shouldn't have included that in my rant either. My main gripe is with the "JSON Everywhere" approach. :)

There's no one-size-fits-all solution to anything. If one is using JavaScript—great, use JSON as a way to transmit objects over the wire or unpack an object into a template. Just PLEASE do not use it for a configuration format. Visual Studio Code configuration is a nightmare of ugliness.

marcosdumay|2 years ago

> We already had INI, XML/XPATH/XSD.

INI is not a defined language. TOML is the most popular attempt to define it.

XML doesn't really encode the same information as YAML and JSON. (It encodes more, but what is important, it encodes it differently.)

Exchanging your things on the left with your things on the right is guaranteed to make a day turn bad.

dtech|2 years ago

The fact that XML External Entity Processing is a category of vulnerability indicates how wrong your comment is. There's a lot of things wrong with XML, mostly that it's hugely complicated and a nightmare to write parsers for. JSON won because all of that complexity wasn't in it nor needed.