I was finding the difference between JSON and XML. As, both are for data interchange between systems, but there is a big difference between JSON and XML that JSON is more lightweight than XML. But I am unable to find the actual reason that why the JSON is light-weight. What makes JSON light-weight??
One answer I found is that in JSON there is not a lot of extra xml markup. What does it actual mean. Are there some more reasons that describes why JSON is lightweight?
It's just smaller by a linear factor. That's not really smaller. Once compressed, both formats take about the same space.
Remember that programs that already have to use XML aren't going to get simpler by also allowing JSON, they'll get more complex. Extra standards only complicate things unless you get rid of the old standards, and XML isn't going to disappear soon.
XML was designed around the concept of a document. JSON was more about simple data structures. JSON cares less about standards, i.e. it has no schemas, so portability may be more difficult than for someone skilled in using XML. Usually when I have to use some ReSTful service, I'm told to 'read the code' or 'look at the JSON data itself' in order to understand it. I.e. implicit (and quite often, changing) data formats.
Both formats suffer from the problem that they can, in their natural form, only represent trees, not graphs of data. I don't like either format. They both seem half-finished. Object serialisation solves more problems.