In this post, Martin (the language's head honcho) writes:

[XML literals] Seemed a great idea at the time, now it sticks out like a sore thumb. I believe with the new string interpolation scheme we will be able to put all of XML processing in the libraries, which should be a big win.

Being interested in language design myself, I'm wondering: Why does he write that it was a mistake to incorporate XML literals into the language? What is the controversy regarding this feature?

  • 2
    Perhaps he was referring(in the post you linked) to having a simple and consistent core and moving more specialized features to libraries – Zavior Dec 17 '12 at 8:50
up vote 11 down vote accepted

I believe Martin explains the reasoning very well in his post:

I have always tried to make Scala a very powerful but at the same beautifully simple language, by trying to find unifications of formerly disparate concepts.

The problem many languages face when they become more and more popular is that features are wanted by the community and added on top of the language. A worst-case example of this (at least in my book) is C++, where you have pretty much everything, yet not at all in a beautiful unified manner (see for example this question arising from that).

The difficulty, when a language grows due to demands/needs from the community is to add the new features in a way that is consistent with the language's core. And in this respect, the XML literals support of Scala is a sore thumb, because this is a unique thing. It's not really part of a beautiful unified core, but has been added as a once-off solution, whereas the string interpolation is a core concept powerful enough to replace the once-off feature.

  • IMHO, in an ideal world, a language should only contain the core features that allow its developers community to extend it. Extensions should not be part of the core language but should be provided as libraries. So, eventually language revisions may specify new standard libraries but no new language features. Of course, defining such a core language that is powerful enough is not a trivial task, but I think some languages (e.g. Lisp) came pretty close to it. – Giorgio Dec 17 '12 at 10:09
  • Talk about a bunch of whiny programmers. XMl literals in scala are extremely useful. The JSON fan boys probably think they are outdated but forget XML is used in other technologies like SOAP. – annoying_squid Mar 5 at 19:46

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.