←back to thread

Fixing JSON

(www.tbray.org)
139 points robin_reala | 7 comments | | HN request time: 0.671s | source | bottom
1. tootie ◴[] No.12327768[source]
If you did all of that you'd still fall way short of what you have been able to do with XML for probably 10 years. XSD defines structure in terms of inheritance, composition, strong types, numerical ranges, enumerations, referential integrity, namespaces.
replies(3): >>12327878 #>>12327879 #>>12329566 #
2. stouset ◴[] No.12327878[source]
Raise your hand if you miss hand-editing or reading XML.
replies(2): >>12328096 #>>12328137 #
3. DonHopkins ◴[] No.12327879[source]
I'm sure Tim Bray would have some opinions on that.
4. oconnore ◴[] No.12328096[source]
Requiring that a markup language (that must be sent across the wire between multiple buggy parser implementations) be hand editable is a recipe for disaster, and will never be as flexible as building/modifying an appropriate AST in a scripting language.

There's not even a good reason to read HTML anymore. You hit Ctrl+Shift+C in Firefox (or I think it's J in Chrome) and you view the actual machine-parsed DOM structure. The only reason human-editable/readable formats were ever necessary is a lack of appropriate dev tooling.

replies(1): >>12330713 #
5. tootie ◴[] No.12328137[source]
Raising hand. If your IDE understands XSD, it is far easier to do than JSON. Tab completion on all your fields and instant validation of values.
6. alayne ◴[] No.12329566[source]
Those things aren't a goal or desired feature of most JSON use. There's a reason people hated SOAP. XML is better suited for documents. For everything else, XML doesn't work very well.
7. kuon ◴[] No.12330713{3}[source]
I have to agree, I've been working with JSON for 10 years and nearly never touched JSON by hand.