(no title)
jfaucett | 7 years ago
No:
Body:
Wants:
To:
Write:
- YAML
vs. <No>
<Body>
<Wants>
<To>
<Write>
<item>YAML</item>
</Write>
</To>
</Wants>
</Body>
</No>
vs. {
"no" : {
"body" : {
"wants" : {
"to" : {
"write" : [ "YAML" ]
}
}
}
}
}
Which would you rather write?
Nadya|7 years ago
Drawbacks of this are when the program is inconsistent. Was it `nobody.wants.to.write` or `no.body.wants.to.write`? Or alternatively, why is it `nobody.wants.to.read` but `no.body.wants.to.write`?
jfaucett|7 years ago
Made me think there's also a big difference in what nobody prefers reading vs. what nobody prefers writing.
krapp|7 years ago
iainmerrick|7 years ago
Neither does the YAML one? So?
you’re forcing them all to have the same indentation
I don’t know about you, but I always pretty-print JSON, just like I always indent my code no matter which language I’m using.
In fact that’s one of the arguments in favour of significant whitespace -- you’re going to be indenting anyway, so why bother with the brackets? It’s not an argument everyone buys, but everyone still indents their code.
hahamrfunnyguy|7 years ago
JSON is not bad to write by hand. Simple XML isn't too bad either, but I still prefer JSON.
jzelinskie|7 years ago
Here's an interesting example of using bencode which is the object format for BitTorrent:
Jtsummers|7 years ago
FrenchyJiby|7 years ago
stephengillie|7 years ago
falcolas|7 years ago
yellowapple|7 years ago
RandomInteger4|7 years ago
hzhou321|7 years ago
pgt|7 years ago
weego|7 years ago
[deleted]