The success of AJAX and Ruby on Rails points out at another small “revolution” going on for the Web applications – the change in the underlying markup language used to shuffle data back and forth. Classic examples are YAML and JSON. A little bit of history on both and an inspiration for this blog post is here: JSON on the Web, or: The Revenge of SML.
I generally agree with the points presented in the article but I have a thing or two to add. Both YAML and JSON are pretty much specialized object serialization formats – the former for Ruby and the latter for JavaScript. In theory, they could be used for other languages too, but in practice these are the two places where they are used.
It all makes perfect sense. If what you are trying to do is to serialize and deserialize an object graph, round-tripping through the XML might not be the best thing to do. It’s not too hard to design a specialized format that will cover your needs better than an equivalent XML, where better is usually defined as faster to parse, easier to read (by a human) and more compact, as long as you narrow the scope enough.
But the point is that this does not make XML any worse than it is. I see XML as an interchange format between different operating systems, machines and different programming languages. XML is often used as a format for a DSL (domain specific language). It may not fit hundreds of tasks very well, but it will fit thousands good enough.
The XML is never (and I postulate it never was) a be-all solution to various kinds of problems. Here’s an example – since Ant, we have seen several build systems (libraries that help you build your code) based on XML, one of the latest being Microsoft’s (quite well thought out) MsBuild. All these build systems are easy to author, easy to read and work really well. One would think that all has been said an done regarding build systems (using current generation tools and languages). But then rake came out and changed everything. Instead of “interpreting” or deserializing the build DSL (expressed as XML) the DSL is embedded in the host language (Ruby). The integration works even better than Ant and MsBuild IMHO. For a really thorough and well-written discussion check out this article by Martin Fowler: Using the Rake Build Language.
The way I see it, JSON, YAML and XML will continue to co-exist; we may even see the proliferation of other specialized languages. That does not make any of them better or worse than the other – they are not here to compete, but each to be used well in its problem domain.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5