Re:Ten predictions (2004)
by jodrellblank on Friday February 15, 2013 @05:37PM
(#5229116)
<user name='joe' age='12' />What about bob?
Re:Ten predictions (2004)
by jodrellblank on Friday February 15, 2013 @09:55PM
(#5230140)
I'm sure you're capable of filling in the pattern with <user name='bob' age='23' /> yourself.
I wasn't trying to show XML is as compact as JSON, only that it can be more compact than the claim "it's so verbose" made it look.
Yes. And then you have to find a way to parse that.
JSON always comes with ready made parsing.
Man, that was funny!
Re:Ten predictions (2004)
by mattmanser on Saturday February 16, 2013 @06:35AM
(#5231188)
{'users': [{'name': 'joe', 'age': '12' }, {'name': 'bob', 'age': '23'}]}
<users><user name='joe' age='12' /><user name='bob' age='23' /></users>Yeah, that's cool and all, but I avoided using XML with attributes because attributes can't / don't nest.
{ name: 'joe', dob: { m: 1, d: 2, y: 1934 } }
<user name='joe' dob='...???...'>
<user><name>joe</name><dob><m>1</m><d>2</d><y>1934</y></dob></user>
I actually wasn't trying to make the "XML is bigger" joke because that isn't what's important to me. Structurally XML is harder to use.
Re:Ten predictions (2004)
by FlyingAvatar on Sunday February 17, 2013 @09:35AM
(#5235295)
Not to be pedantic, but:
{users: [{name: 'joe', age: 12}, {name: 'bob', age: 23}]}
<users><user name='joe' age='12' /><user name='bob' age='23' /></users>
* attributes v. tagnames
* no "anonymous list"
* infinitely large surface area
[ {name: joe, age: 12 }, {name: bob, age: 23} ]
<list><user><name>joe</name><age>12</age></user><user><name>bob</name><age>23</age></user></list>
The access pattern for json is much easier: obj[1].name
The infinitely large surface area of XML is painful.
Namespaces, entities, xsd/schema, cdata, cdata-in-cdata.
It's an alright data / interchange format and especially suited to certain multi-vendor use cases, but the disadvantages cost more than the benefits compared to "simple" anonymous json.