logoalt Hacker News

zarzavattoday at 4:50 AM2 repliesview on HN

You have to use the right tool for the job.

XML is extensible markup, i.e. it's like HTML that can be applied to tasks outside of representing web pages. It's designed to be written by hand. It has comments! A good use for XML would be declaring a native UI: it's not HTML but it's like HTML.

JSON is a plain text serialization format. It's designed to be generated and consumed by computers whilst being readable by humans.

Neither is a configuration language but both have been abused as one.


Replies

ahf8Aithaex7Naitoday at 6:04 AM

> It's designed to be written by hand

Are you sure about that? I've heard XML gurus say the exact opposite.

This is a very good example of why I detest the phrase “use the right tool for the job.” People say this as an appeal to reason, as if there weren't an obvious follow-up question that different people might answer very differently.

locknitpickertoday at 6:21 AM

> It's designed to be written by hand.

This assertion is comically out of touch with reality, particularly when trying to describe JSON as something that is merely "readable by humans". You could not do anything at all with XML without having to employ half a dozen frameworks and tools and modules.

show 1 reply