Ever since I started programming in .NET land I’ve been a C# bigot. The syntax jives with my brain. When I come across code samples presented in both VB.NET and C# I gloss over the VB.NET code in all it’s verbosity and jump directly to the real code (C#)
.
Since the May CTP drop of Linq I’ve been working my way through the various technologies (Standard Query Operators, Lambda Expressions, Expression Trees, Linq to Sql, Linq to Xml, etc) in an attempt to get a feel for what’s available in Linq and what changes it might bring to my daily programming life when I’m able to use it in production applications.
I’ve semi-recently gotten to XLinq and it has me envying VB.NET programmers! The Xml literal support within VB.NET is pretty sweet. For those of you who don’t know what I’m talking about the next version of VB.NET has built in support for constructing Xml using literals. As a quick (also known as “lame”) example imagine that you have a PurchaseOrder class that you need to represent as Xml. Wtihin VB.NET you can build the Xml representation of the PO using a combination of Xml literals and embedded expressions. The result looks amazingly similar to ASP.NET due to the shared <%=expression%> syntax.
Public Class PurchaseOrder
Public PODate As Date
Public Number As String
Public Function AsXml() As XElement
Return <purchaseOrder><poNumber date=<%= Me.PODate.ToString() %>><%= Me.Number %></poNumber></purchaseOrder>
End Function
End Class
* Note: This is the first VB.NET code I’ve written since Beta 1 of .NET 
To be fair it should be mentioned that the functional construction of Xml that is provided by XLinq makes creating Xml without xml literals pretty darn nice as well…especially when compared against what we’re used to with existing Xml API’s.