Friday, February 16, 2007
« Recommended Reading | Main | Hey Apple, can you put a couple engineer... »
I'm with Mike, C# 3.0 needs the Visual Basic 9 XML Syntax.  Maybe "needs" is a strong word, since the functional construction model used for building XML with LINQ to XML is head and shoulders above what we have available in today's XML API's, but it sure would be nice!  Since the VB guys already have it done it should be a piece of cake to move over.  Those Microsoft guys have mad skills, I expect it to be in the next CTP! :)

Friday, February 16, 2007 2:41:58 PM (Eastern Standard Time, UTC-05:00)
I wouldn't hold my breath on this one. I've gone from not wanting XML Literals in C#, to wanting them in C#, back to not wanting them in C#. Anders seemed pretty set on not allowing them in C#, but, you never know. The best we have now is the Paste as C# macro (which does what the VB Compiler does, but when you paste in XML to a C# class, not at compile time).

Daniel Cazzulino (aka kzu) has a possible solution post up on the Mvp.Xml project discussion list, http://www.codeplex.com/MVPXML/Thread/View.aspx?ThreadId=7193 that uses a typed template rendering class (XML Typed Templates). IMHO, kzu is on the right path, just not the right implementation (yet), which is why I've switched my vote back to not for XML Literals in C#. My goal is to use some sort of compiler extensions to add XML Literal-like functionality in C#.

Don Demsak
Friday, February 16, 2007 4:52:02 PM (Eastern Standard Time, UTC-05:00)
I'm certainly not holding my breath, since I've heard the topic come up many times and it's always been quickly dismissed as something that wouldn't be put into C#. With that said, I've come to really like the XML Literals support in VB, and being that I'm a C# guy I would like to be able to use it. Perhaps the answer lies in an alternate solution, such as that being developed by kzu. My personal preference would be that the solution would be the same in both C# and VB, but as you said, that looks unlikely at the moment.
Friday, February 16, 2007 5:27:12 PM (Eastern Standard Time, UTC-05:00)
Funny to notice that this first appeared in COmega, but only materializes in VB in the end.

Daniel's solution is very nice. In fact it may be better to have a dedicated language like this rather than adding XML capabilities to C#, provided that the language is typed and errors are raised at compile-time if the members used in the "template" are wrong. Of course, I agree with Steve, the solution should be the same for VB and C#. We need a .NET way to do this, not a language one. Oh well, simple: remove XML Literals from VB and use a common solution :-)

What we need exactly is the XML Literals syntax to be supported as is completely by Daniel's templating language. We need all LINQ and XML Literals features in there, with nested LINQ queries and all. Of course, without the underscores ;-)
Saturday, February 17, 2007 5:05:39 PM (Eastern Standard Time, UTC-05:00)
Think of it this way: C# has had a kind of JSON literal support from the very beginning :-)

But seriously, what's wrong with using VB9 in parts of a project where literal XML would be useful, and C# in the parts where its many desirable features shine?
Saturday, February 17, 2007 5:07:02 PM (Eastern Standard Time, UTC-05:00)
Nothing is wrong with that per se, however, the majority of projects I work on these days have a standard language that is used throughout. Perhaps if VB9's XML Literals, and other features, are compelling enough I'll start to use multiple language in my projects, with each silo using the language that is most appropriate. Honestly, I don't see that happening though. I'll use my preferred language, C#, and make do with the features available and complain about how that stinkin' XML team at Microsoft wouldn't give me what I wanted! :)
Sunday, February 18, 2007 5:48:38 PM (Eastern Standard Time, UTC-05:00)
Fabrice,

The reason XML Literals where in C-Omega and found their way into VB 9 is pretty logical once you know the backstory. Erik Meijer was one of the project members on C-Omega, and he is now an architect for Visual Basic.
Monday, February 19, 2007 4:34:16 PM (Eastern Standard Time, UTC-05:00)
Sorry, no XML literals in C# 3.0. However, if you accidentally *tried* to use them in the original Sept05 LINQ preview prototype c# compiler, you might have been surprised to see them actually work. :-)
Monday, February 26, 2007 1:12:05 AM (Eastern Standard Time, UTC-05:00)
What if we accidentally *tried* in the final version of C# 3.0, do you think perhaps, just maybe, you could make it so it would work :) I promise not to tell.
Tuesday, October 16, 2007 12:59:23 PM (Eastern Daylight Time, UTC-04:00)
Hello Hans! If you want my opinion on this, I think you should check for the hardware condition of your computer, because freezing applications are often associated with cpu overheating or RAM failure.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):