Whirlwind Screencasts Highlight New Features in C# 4

channel9logoStuart Celarier and I continue the set of screencasts on Channel 9 about new language features in C#. It's a Whirlwind Tour of the important language features of C# 4. Stuart describes each major feature and why it is useful. But he doesn't get into best practices nor suggested usages. Just the facts about each feature.

Whirlwinds are bite-sized webcasts, generally shorter than 15 minutes. You can start anywhere in the series to learn about the parts you're most interested in.

What's new in C# 4

  • Whirlwind 9 - Introducing C# 4 . This short session quickly reviews the history of C# and provides an overview of the features in the upcoming screencasts.
  • Whirlwind 10 - Dynamic Lookup .   This session on dynamic lookup introduces a new pseudo-type dynamic into the C# type system. It's used to call dynamic languages, certain COM objects, or dynamic structures like XML using types that are not known at compile time. Stuart introduces the concepts of dynamic lookup and how you use it in your C# code.
  • Whirlwind 11 - Named & Optional Parameters . Stuart describes two features that VB programmers have always had: using parameters by name and having default values set on parameters that are not specified.
  • Whirlwind 12 - More COM Love . Stuart describes the importance of these two new features in C# for COM Interop.
    • The ref keyword is optional if you are not going to use a return value when calling COM.
    • A compiler option now makes is so that no Primary Interop Assembly (PIA) is required.
  • Whirlwind 13 - Covariance & Contravariance . These features provide way for you to access collections of derived classes and base classes. Stuart demystifies the differences between co- and contravariance, and even gives you a good way to remember which one’s which. 
  • Whirlwind 14 – Events . Stuart discusses a change in how the compiler handles eventing. The compiler acquires a lock when adding or removing event handlers, instead it uses compare and swap technique. Stuart compares C# from .NET 3.5 and .NET 4 to show the differences and explains the implications for your existing code.

Download code samples from VisualStuart.net. Also check out Stuart's blog posts C# 4 on Visual Stuart.NET.

Discover the entire series on C#

What's new in C# 2
What's new in C# 3

Getting Started with C#

Bruce D. KyleISV Architect Evangelist | Microsoft Corporation

cid:image010.png@01C9DEED.1FDB2200 cid:image011.png@01C9DEED.1FDB2200 cid:image012.gif@01C9DEED.1FDB2200 channel9

Add to Technorati Favorites

Bookmark and Share