Daniel Cazzulino kick started the whole “Is XLINQ’s XML Literals a bad thing” issue with his post, XLinq: is XML embedded in a host language a good idea or a terrible one?. Mike Champion replied on the XML Team blog, XML literals undermine the MVC paradigm? and wants more feedback from the general public.
I talked about this very topic back in Oct in my XAML + XLinq + VB.Net's XML Literals Equals Classic ASP For WinForms? and is a good place to start if you need a refresher on the whole VB XML Literal thing in XLINQ. I started with what it looks like in today’s world to build an XML document via code, and bring you up to speed with the XLINQ enhancements.
The issue isn’t if XML Literals should exist, but more of how to get the right balance and protect the prototypical RAD developer from themselves, so they don’t just recreate the Classic ASP Spaghetti Hell that was prevalent back in the day. I am totally fine with the VB team adding a feature like XML Literals to the VB language. Instead of VB becoming an also ran, always chasing what Anders and the C# team accomplish, this would give VB a distinguishing feature. The problem with adding XML Literals to VB is that it gives VB.Net more of that "toy" language feel of old VB.com, something that you could quickly develop a prototype in, but not a language that you really wanted to use in an enterprise environment. As a former VB programmer that built enterprise apps with VB, I know that feeling all too well, and had hoped that it would never return. But, I can also see that many VB programmers do not like the current direction of the language. Something like this may enable the language to be able to appeal to the VB folks that loved the RADness of VB.com. I'm not one of them, but I can see their point. I have since moved on to using C# as my primary language, which is probably why I don't mind the VB team adding XML Literals.
What I'm not fine with is a feature like this getting added to C#. My vote would be to keep the faith and continue with the idea of using C# at the language of choice for enterprise development, and avoid the temptation to enable spaghetti like coding styles. But that is just my opinion.
Others have contacted me and disagree with my take on XML Literals giving VB.Net a more “toy” feel since in the past that perception stemmed from missing functionality and the ability to optimize performance. I agree that VB.Net is, and will continue to be, just as good as C# in writing enterprise ready applications. The problem is that using VB.Net and XML Literals VB.Net becomes an enabler of poor programming habits. I had the same compliant with Edit and Continue in C#, and lost that battle, too (so what do I know?). I have the same issue with the VB.Net IDE (example, it totally disregards the concept of Namespace and forces the VB programmer to insert the Namespace declarations by hand, or suffer with the “derived” namespaces). The issue moves from “whether VB can be used to write enterprise applications” to the image of a VB programmer as someone that can’t write enterprise ready applications. Yes the VB language can be used to write enterprise ready applications, but does the typical VB programmer understand good programming techniques? I’ve started to call the folks that are totally dependent on wizards to create applications Wizard Droppers, and unfortunately the majority of these folks seem to come from the VB ranks. Enabling them to continue with this development style by letting them drop XML into their code will only continue to reinforce this image. I’m not saying to drop XML Literals, but to understand what it will do to the image of a VB programmer if proper steps are not taken to make sure that it isn’t abused. The way it looks and feels now, it is too easy to write ASP Classic style code with XML Literals. This stuff is still early tech previews, so I’m confident it will get better, but not if we don’t raise our concerns.
If I had my way, things like turning off option explicit and option strict would be disabled in the professional versions of Visual Studio, but I’m an extremist.