Posted By: Jason Olson | Nov 11th, 2008 @ 9:15 AM | 90,873 Views | 16 Comments
The topic of "C# 4.0" is an area we've been diving into a bit lately. So we took this opportunity to sit down with Niner-regular Anders Hejlsberg and C# Community PM Charlie Calvert to dive into some of the most common questions we are hearing about C# 4.0 and the reasoning behind some of the answers.

If you are not familiar with C# 4.0 or want to dig into some other C# 4.0 resources, make sure to check out the following videos:
[PDC] The future of C#, Anders Hejlsberg
Inside C# 4.0
- C# 4.0: Meet the design team

Also make sure to check out Charlie's blog and some of the resources he and the team have made available on MSDN:
- New C# 4.0 Features Paper
- Covariance and Contravariance in C# 4.0
- Community Convergence 47


This is another Visual Studio 2010 and .NET Framework 4.0 Week Video. For other Visual Studio 2010 videos, check out the Visual Studio topic area here on Channel 9.
Rating:
3
0
I think I've watched that bit of Anders presentation at PDC 2008 where he cons's up a eval loop using C# '5' more than half a dozen times now. Reminds me of the F# demo Don did a while back where he created and hooked up a WinForm on the fly. Having this in C# will be utterly cool and I really hope Anders et al can make good on their hopes of getting the 'eval' stuff out to us some time before Visual Studio 2012! Huge kudos to the whole C# team, your compiler continues to be a big contributing factor to my on-going love affair with programming!
As usual, Anders presents us with all the goodies, packaged up in time for Christmas. A paedagogical talent as well.

The explanation of dynamic is very good and should lay to rest the unfounded criticism of the feature. Of course anytime you introduce another hammer there's a chance someone else use it to knock themselves out, but it sure is a nice thing to have.  The examples of DOM and REST are very good and I'm very intrigued to explore them closer.  Some things are indeed inherently dynamic and "unsafe", you just have to box them in, and that is exactly what the dynamic type does.

Also looking very much forward to the next VS with MEF and "AST coloring" (okay, bad term).

Kudos to the team from Denmark Smiley
I wanted to ask Anders: any chance to get covariant return types for overridden methods in the near future? I know the co- and contra- variance features will be added only for generics, delegates and interface types so I was wondering...

I completely agree with the question on covariant return types. When I met Anders at the PDC bookstore I really tried to get the message across and I've been pushing the request for a long time (as have numerous other people in the community).

cp10000
cp10000
Hi

When can we have a downloadable document about the C#4 language?   There is already one for C#3.   I am looking forward for a downloadable document for C#4.

Oh, this is really cool! I met Charlie Calvert at this MVP Open Day in Beijing, but I never met Anders yet. I'll download this video later, and thank you all in this video.
Anyone else having trouble viewing the videos on the site? None of the video links work - only audio. Sad
staceyw
staceyw
Before C# there was darkness...
Love Anders and would not presume to know anything compared to him, but did he really say XElement is a good alternative for VBs XML support?  I think I would rather chew glass.  Sure you can make it easier with an extention method like:

 var xml =
@"<Users>
    <User>user1</User>
    <User>user2</User>
</Users>".ToXML();
Console.WriteLine(xml.ToString());

        public static XElement ToXML(this string xmlString)
        {
            return XElement.Parse(xmlString);
        }

But that lacks two major things, compiler support and designer support.  Naturally, it becomes a slippery slope of what meta languages to support as the next question becomes support for JSON and M.  I think M makes this more interesting as I think we will need compiler support for that.  So should M, JSON, and XML have compiler support in c#?  Why or why not?  Could these be opt-in/opt-out extentions to the language?

Microsoft Communities