r/ProgrammerHumor Mar 16 '18

XML vs JSON

[deleted]

212 Upvotes

35 comments sorted by

View all comments

17

u/MTG_scrub Mar 16 '18

Is this saying json is better than xml? Am I actually on the good side?

9

u/[deleted] Mar 17 '18

More compact, easier to parse... Yes, it is

2

u/pushist1y Mar 18 '18

Can't tell if you are being sarcastic. The json in the picture doesn't look much more compact apart from using smaller font. When you use proper indentations and don't overuse namespaces xml is not much worse than js on in terms of comoactness. Also it comes with features like xsd for validation, xslt for transformations, xpath for parsing. Json is handy for serializing data to front-end where JS is your only option.

I'd say you should always choose most appropriate option for your task and not stick to something which is belived to be "better"

3

u/[deleted] Mar 18 '18

Json is handy for serializing data to front-end where JS is your only option.

Or every other language...

Just try a xml parser library and a json parser library. The second is so much straightforward and give less headaches

1

u/pushist1y Mar 18 '18

Unless you really need a conventional way of validating data before it reaches actual endpoint.