3 ms·
It's important to note here that JSON is essentially XML without the boilerplate - and in fact was invented at least partly to address this very XML pain point.
by RyanMcGreal 17y ago
It's important to note here that JSON is essentially XML without the boilerplate - and in fact was invented at least partly to address this very XML pain point.
- evgen 17y agoSo it is essentially XML except for all of the things that make XML any different than csv or some other text-based representation?
- RyanMcGreal 17y agoI don't think your comparison is fair. CSV has only one structure (tabular data) and only one datatype (string). JSON supports multiple datatypes and data structures (objects, lists, hash tables).
- neilk 17y agoAbsolutely not. XML has its roots in document creation for large organizations, and has a structure appropriate for that -- mostly an ordered graph of text nodes, which do not need to be declared (and indeed are not consistent between parsers), with provision for special node types with their own contents. But early in its history XML got hijacked by a lot of comp-sci theorists who wanted to create highly abstract notions of messaging, separating message validity and provenance from application logic. This gave the world things like XML Schemas and SOAP and worse. Meanwhile, JSON is a straight representation of common scripting language data structures. Arrays, dictionaries. Simple. Node boundaries are syntactically explicit. In this philosophy is taken for granted that message validity will be ascertained at the application level. There are no fantasies of doing so at the document parsing level.