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?
1
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.
2