Earlier quoted context omitted.
JSON is explicitly not designed to be hand-editable. Hence, for example, no comments. It's just meant to be human readable. If you want human editable "json", use Yaml: http://www.yaml.org/ (it's a superset of Json that adds comments, linking etc.)
How is YAML a superset of JSON? Do you mean 'conceptually'?
Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
31–40 of 265 posts
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#32What's with all the XML hate? Of course, doing everything in XML is a stupid idea (e.g. XSLT and Ant) and thanks heaven that hype is over. But if I want something that is able to express data structures customized by myself, usually with hierarchical data that can be verified for validity and syntax (XML Schemas or old-school DTD), what other options are there? Doing hierarchical data in SQL is a bitch and if you wan…
The issue is probably that 99.999% of all XML use cases don't use (or need) the verification aspect. For all of those, XML is overkill. Besides, surely it would be possible to design a verification layer on top of JSON, for instance - the fact that one does not currently exist does not mean that XML (and abuse of XML!) should not be criticized.
{ "name": "bob", "salary": 1e999 }
Ah crap! Deserializer blew (in most cases silently converting the number to null)
bob
1e999
No problem. The consumer can throw that at their big decimal deserialiser.And the following is not acceptable as it breaks the semantics of JSON and requires a secondary deserialisation step as strings ain't numbers...
{ "name": "bob", "salary": "1e999" }
JSON is a popular format but it's awful.Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#33I don't quite get Linus' problem with XML for document markup (for anything else - config files, build scripts - sure, XML is horrible). Does anyone know any more details about what his specific gripe is? For me, asciidoc (which looks very similar, conceptually, to markdown) suffers from one huge problem: it's incomplete. Substituting symbols for words results in a more limited vocabulary, if that vocabulary is to re…
For those who missed it, here's what Linus wrote in the comments: "+Aaron Traas no, XML isn't even good for document markup. Use 'asciidoc' for document markup. Really. It's actually readable by humans, and easier to parse and way more flexible than XML. XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horribl…
I just had a quick scan of the user guide. It's very impressive. Looks like markdown but with all the edge cases thought out.
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#34Earlier quoted context omitted.
JSON is explicitly not designed to be hand-editable. Hence, for example, no comments. It's just meant to be human readable. If you want human editable "json", use Yaml: http://www.yaml.org/ (it's a superset of Json that adds comments, linking etc.)
How is YAML a superset of JSON? Do you mean 'conceptually'?
However, I hate YAML with a passion. It is worse than XML in my books. I can usually read JSON fine. I can also read XML in many cases. For the life of me, I just can't read YAML. It has something to do with "-", line indentation and different ways of writing lists.
Of course, someone will say YAML is technically better ...
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#35I think this title is wrong. Firstly some clarification - this appears to just be about the persistence format for his dive log. It was XML, now it's git based with plain text. As someone who had to manage a system which worked with plain text files structured in a filesystem for a number of years in the 1990s, this is done to death already. You now end up with the following problems: locking, synchronising filesyste…
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#36I think this title is wrong. Firstly some clarification - this appears to just be about the persistence format for his dive log. It was XML, now it's git based with plain text. As someone who had to manage a system which worked with plain text files structured in a filesystem for a number of years in the 1990s, this is done to death already. You now end up with the following problems: locking, synchronising filesyste…
Maybe you want to wait till he release something. Cause you know, if he took months to get the big picture in mind, I doubt you grasp what he envision just by reading his comment.
There's not much more to infer from the comment.
Unless he's invented a new ASN.1 encoding which plugs into libgit or something or a new text serialisation format (both unlikely).
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#37Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#38> "I actually want to have a good mental picture of what I'm doing before I start prototyping. And while I had a high-level notion of what I wanted, I didn't have enough of a idea of the details to really start coding." This I like. The race away from the waterfall straw man has also stripped us of the advantages of BDUF. While rigid phase-driven project management helps nobody, I think there's still room for speccin…
A lot of people use AGILE to avoid planning at all, which is a particular destructive anti-pattern, and the exact opposite of what you need.
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#39Title is entirely misleading. Tech support! TECH SUPPORT!!
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#40Earlier quoted context omitted.
The issue is probably that 99.999% of all XML use cases don't use (or need) the verification aspect. For all of those, XML is overkill. Besides, surely it would be possible to design a verification layer on top of JSON, for instance - the fact that one does not currently exist does not mean that XML (and abuse of XML!) should not be criticized.
One of the core aspects of XML that is really important is that no typing is inferred by the structure of the file unlike JSON. JSON is by nature tied to the JavaScript type system which is sparse and inaccurate. For example, if you look at the following: { "name": "bob", "salary": 1e999 } Ah crap! Deserializer blew (in most cases silently converting the number to null) bob 1e999 No problem. The consumer can throw th…
The problem I think is that just because XML is human-readable, it's less sufficient as a format that is human-writable (I'm looking at you, Maven!). I believe this is the root cause that many people hate XML, even though it has a very sweet spot in application-to-application communication.