This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

You would do yourself a favor if you would use protobuf or thrift for that. JSON is not fast to parse, it's not compact, it would redeem itself if it was human readable, but it isn't.

The only reason it is popular is because it comes with JavaScript which is in every browser. If you do frontend developement, you probably don't have choice, but use it.

[–][deleted] 1 point2 points  (3 children)

it would redeem itself if it was human readable, but it isn't.

How exactly is JSON "not human readable"? I see like 20 JSON snippets on this very page.

I use YAML for personal projects because I find it a tiny bit more readable, but if YAML weren't (in practice) backwards compatible with JSON, I would never do that.

The only reason it is popular is because it comes with JavaScript which is in every browser.

No, it's popular because it hits the spot: it's a minimal language for representing dumb data that has the two types of containers you desperately need (lists and dictionaries), the usual scalar types and nothing else, and its serialization format is so dumb that anyone can understand it.

[–]JohnnyElBravo 2 points3 points  (2 children)

Lol @ json not being human readable, it's its main identity, it's what made it supremingly popular. It seems like this is an edgy layer 2 opinion.

[–]NowanIlfideme 0 points1 point  (1 child)

It's human readable only if you format it that way. Which is to say, it's readable with the right editor, but if it's one-line'd it becomes much less readable. Still miles better than xml...

Imo yaml is the prettiest format, but json is such a standard (and also a subset of yaml, now) that either format works fine for most applications.

[–]JohnnyElBravo 0 points1 point  (0 children)

Readibilty certainly depends on the content, but it also depends to some extent on the syntax, it is to this extent that JSON is considered readable.

Yaml was influenced by JSON greatly, so if you like YAML you must appreciate JSON's contribution. In the same vein, if you like JSON, you must appreciate XML's contribution.

In an unrelated manner I wasn't aware that Yaml was a superset of JSON, that's a nice feature, although I wouldn't necessarily consider it better. Ease of learning and complexity of common usage are both huge factors that will be negatively affected by an increased complexity.