3 ms·
Now try to apply this to the real world. The most popular and widely used SGML-derived format by far is (X)HTML. Show me e.g. how a paragraph with a few embedde
by olavk 15y ago
Now try to apply this to the real world. The most popular and widely used SGML-derived format by far is (X)HTML. Show me e.g. how a paragraph with a few embedded links is improved by translating to JSON.
It is not. Of course some kinds of data are indeed expressed simpler with JSON.
Another real world example is RSS. More data-y that HTML but still may contain mixed content. Would it be better if it had been JSON from the beginning? The answer is not clear cut.
So maybe JSON is not always the right answer. Maybe it depends on what kind of data you want to express. But then it suddely is not a debate with a "XML-defenders" which "dont get it". Then it is a discussion about which tool is approprite in a given situation rather than a war between tribes. And how do you boost you ego and sense of superiority with a boring debate about tools?
- raverbashing 15y agoPopular != Better "Show me e.g. how a paragraph with a few embedded links is improved by translating to JSON." Even though HTML and XML are related, something like a web page is so ingrained that would be difficult to change And JSON was never a markup language The criticism of XML goes much more towards using it as a 'Key/Value' serialization format. But you could imagine something like that (commas and colons would have to be replaced in a 'JSON' markup language) {p: Read it on {href:news.ycombinator.com, a:Hacker News}} Size gains, parsing speed gains. RSS is not as clear cut, really, it's not a complicated structure, so it could be YAML for example "So maybe JSON is not always the right answer. Maybe it depends on what kind of data you want to express" XML has attributes, which I'm not against (unlike the article) and it has a more natural nesting of information. But for the majority of data, yes, JSON is better This is about coder productivity (which is increased with JSON it's not even funny), either in Python/Java (even with the whole swiss army knife of XML libs they have)/C# or others. Speed is also a issue. Encoding and decoding XML is slower, even with C speedups (example: Python lxml). And this is relevant for transformation of data or even sending it to the user.
- rjknight 15y agoThis was exactly the point addressed in the OP. Quote: * SGML is a good idea when the markup overhead is less than 2%. Even attributes is a good idea when the textual element contents is the "real meat" of the document and attributes only aid processing* In your example where you want to add a small amount of markup to a large amount of text, SGML wins. JSON is a worse choice for such cases. It seems to me that we have collectively solved these problems, which is why we have both JSON and XML. Naggum was right when he said that XML was being applied incorrectly, and Douglas Crockford solved the problem by introducing JSON.