Title Image

Don Xml's Grok This

The home of Don Demsak
Welcome to Don Xml's Grok This Sign in | Help
in Search

This Blog

Syndication

Site Sponsors

DonXml's All Things Techie

XLINQ XML Literals - Reemergence Of Classic ASP Spaghetti Hell?

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.

Published Friday, February 03, 2006 7:30 PM by donxml
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Mike Champion said:

As I think I said more privately, this has been a real discussion-starter in Redmond. The fact that most of us don't fully agree with you and kzu doesn't detract from that. I do find myself wondering if "wizards don't write crappy code, crappy coders write crappy code with wizards" is really the best we can do.

While trying to derail XML literals in Orcas is probably tilting at windmills, I for one would be extremely interested in getting more ideas on how we can make it easier to work around the numerous mind-numbing hassles of current XML APIs without making it too easy to create an unmaintainable mess. At a minimum, this thread has made it clear that we need to work harder to explain what we're trying to accomplish, and warn people away from the pitfalls.
February 3, 2006 11:16 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About donxml

I’m an independent consultant, specializing in .Net solutions architecture, based out of New Jersey who also doubles as an evangelist for XML, Domain Driven Design, enterprise architecture and .Net. I do not work for Microsoft, the W3C or any other big company that you may know of (at least not yet). I’ve been an indie for over ten years, and although I’ve been tempted a couple times to take a job with companies like Microsoft, I’ve haven’t found something better than my current situation. I work mostly with the large pharmaceuticals that are based here in New Jersey, and usually find myself on long term contracts. Definitely not the prototypical indie consultant, but it lets me dedicate time to my non-income generating activities like the developer community stuff, plus financing open source projects like XPathmania and MVP-XML. If you would like to talk to me about doing some contract work, just contact me via the contact page. My rates vary widely, depending on lots of different variables, but mostly distance from Jersey, and type of work. Plus, I’ve been known to donate some of my code for various projects.
Powered by Community Server, by Telligent Systems