Whirlwind Screencasts Highlight New Features in C# 4
Stuart 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
- Whirlwind 1 - Generics
- Whirlwind 2 - Iterators
- Whirlwind 3 - Partial types, Anonymous methods
- Whirlwind 4 - Accessors, Static Classes, Nullable Types
What's new in C# 3
- Whirlwind 5 - Automatically Implemented Properties, Type Inference, Initializer
- Whirlwind 6 - Anonymous types, Extension method
- Whirlwind 7 - Lambda Expressions
- Whirlwind 8 – Linq
Getting Started with C#
- For more information about how to get started writing in C#, see Getting Started with Visual C# on MSDN.
- You can get started with C# using the free edition of Visual Studio 2010, Visual Studio Express .
- If you are a startup, you can get developer tools for nearly no cost through BizSpark.
Bruce D. KyleISV Architect Evangelist | Microsoft Corporation