News for hackers. Stuff that matters.
Re:JSON Feed by sacheendra on Wednesday May 17, 2017 @06:09PM (#14363258)
IMHO the boilerplate code is much easier to read than understanding the nuances of XML if I have to read a document.

{"type":"currency", "unit":"euro", "amount": 10}

feels easier to understand than

<currency unit="euro">10</currency>

Re:JSON Feed by mindcrime on Wednesday May 17, 2017 @07:14PM (#14363608)
Maybe it's just conditioning, but I find the latter example easier to read and understand. In fact, I'd say that - in general - I find XML better in terms of human readability than JSON. I guess it just goes to show that we all see certain things differently. shrug
Re:JSON Feed by abritinthebay on Thursday May 18, 2017 @07:35PM (#14371932)
I think that's totally reasonable - because it was after all one of the goals of XML. That is, to be human readable.

There is a difference however between readable + parsable vs parsable + easily dealt with.

XML was not the latter. You have to do more work to traverse and handle XML inside your application than you do JSON, and most of the (reasonable) reasons for this are due to features that most cases don't need.

JSON makes the common case easy, XML doesn't.

Re:JSON Feed by DougWebb on Wednesday May 17, 2017 @06:55PM (#14363512)
How about:

<rec type="currency" unit="euro" amount="10" />

I don't think your problem is with the syntax, necessarily. It seems more like you prefer name/value pairs over semantic markup.

Re:JSON Feed by moolcool on Wednesday May 17, 2017 @10:07PM (#14364367)
The biggest problem with XML is how easy it is to make a very bad schema, and how hard those can be to parse