3 ms·
After three years working in Big Freaking Java Web Applications which needed to frequently talk to other Big Freaking Legacy Applications, which is pretty XML's
by patio11 16y ago
After three years working in Big Freaking Java Web Applications which needed to frequently talk to other Big Freaking Legacy Applications, which is pretty XML's core use case, I struggle to think of a concrete example of a time where XML was a clear win over JSON. I spent a lot more time fighting XML (and, more importantly, libraries built on libraries built on libraries which parsed XML which failed to interact with libraries built on libraries built on libraries which parsed XML in a subtly different and incompatible way) than I spent enjoying the richness of my namespaced mixed content.
We were once, no lie, forced into JSON-over-XML because of technical and organizational imperatives that had to be reconciled with the need to ship functional code sometime this year. ("The web services parser is breaking again!? Screw it. We only need three fields. JSON grab bag, serialize as string, read string and interpret as JSON on other side.")
- jimbokun 16y ago"After three years working in Big Freaking Java Web Applications which needed to frequently talk to other Big Freaking Legacy Applications, which is pretty XML's core use case" This is absolutely, positively, NOT XML's core use case. This is yet another case of Big Freaking Java Web Application developers finding a way to add gratuitous complexity, along with their dependency injected, aspect oriented, AbstractDataSourceFactoryFactoryImpls. By the way, a quick Google brought up this, which is evidently not a parody but actual code: http://www.docjar.org/docs/api/org/outerj/pollo/xmleditor/FactoryFactory.html http://www.docjar.org/docs/api/org/outerj/pollo/xmleditor/Fa... The mixed content case does not occur in the vast majority of Big Freaking Java Web Applications.
- patio11 16y agoThere are sometimes when the closest route to the goal, given that you are building a Java web application, runs through very small voice a factory factory. They're a possibly degenerate consequence of the interaction of a few things which, separately, defensible ideas. One of these things is that you want to be able to pass objects over the wire without having to reduplicate all the code on both sides. For example, if you have Student objects in the student management system and also have Student objects in the university SNS, and those systems need to periodically pass data between each other, somebody might say "It would be great if they could do that without us having to custom-write data massaging routines. After all, we already have student code on both systems." and another guy might say "True, true, but we don't want to keep the Student class in sync on both systems neessarily." and then a choice gets made and someone forgets that one of the Students contains a graduation date implemented by a long-forgotten contractor as a wrapper class with some utility functionality which contains a Locale which cannot be serialized and then all of a sudden you are in the sixth layer of XML Hell. Not that I'm arguing with you -- God willing, I will never, ever have to work with Java architecture astronomy again.
- euroclydon 16y agoHTML is pretty much XML, should it be JSON?
- xiongchiamiov 16y agoNo, but it's much nicer to use Markdown and friends for a lot of it. Really, HTML is needlessly verbose and annoying - we're just used to it. If you take a look at something like HAML (not that I agree with all of their choices), you can see how much nicer it could be.
- jamesbritt 16y ago"Really, HTML is needlessly verbose and annoying" That "needless" verbosity makes error correction much more robust. Haml has a shit fit over the slightest of irregularities. The XHTML experience should be proof enough that trying to enforce picky parsing rules or highly context-dependent syntax leads to breakage.
- ElbertF 16y agoTry saving a marked up document as JSON.
- wvenable 16y agoYou make a good point yet outside of XHTML and perhaps XSLT, I've never seen a document marked up as XML. I have, however, worked on hundreds of projects that used XML as a structured data exchange format, for remote procedure calls, or for configuration.
- dfox 16y agoI routinely save HTML markup as S-expressions (S-XML) which is almost as readable (and slightly easier to parse) as JSON, yet markup in it does not look as weird and ugly.