HackerTrans
TopNewTrendsCommentsPastAskShowJobs

MrPatan

no profile record

comments

MrPatan
·il y a 4 ans·discuss
How about less sun or wind than is necessary, instead of the strawman "no wind or sun"?
MrPatan
·il y a 4 ans·discuss
And a week of less solar and wind than usage?
MrPatan
·il y a 4 ans·discuss
Tabs are not valid JSON
MrPatan
·il y a 5 ans·discuss
Parent didn't say it was harder to use from JS. Parent said "It had to be replaced with JSON by the web developers though, so they could just “eval() it” to get their data."

First of all, I was there 20 years ago. I had to deal with XML, XSLT, one kind of Java XML parsers that didn't fully do what I needed, another kind of Java XML parsers that didn't fully do what I needed. And oh boy was it a pain. I just wanted to get a few properties of a bunch of entities in a bigger XML document, that's all. Big fail.

Second, JSON always had a parser in JS, so I don't know where that eval nonsense is coming from.

Third, JS actually had the best dev UX for XML of all languages 20 years ago. Maybe you know JavaScript from Node.js, but 20 years ago it used to run excusively in web browsers, which even then were pretty good at parsing XML documents. The browser of course had a JS DOM traversal API known to every single JS developer, and very soon (Although TBH I can't remember if before or after JSON) it also had xpath querying functions, all built in.

XML was so bad, that its replacement came from the language where it was actually easiest to use. think about that for a second.

So the answer to the question "Why was XML replaced?" is not "Because webdevs lol".

I suspect it was because it has both content and attributes, which all but guarantees it's impossible to create a bunch of simple, common data structures from it (like JSON does).
MrPatan
·il y a 5 ans·discuss
If all the smart people like you used XML, how come it was so painful to use and it died?