New Features in C#

New Features in C# 2.0

by Bradley Jones

From the July 26th CodeGuru newsletter.

The C# language is standardized through ECMA International. This allows for a standardization of the language without the fear of one company controlling it. Said another way, C# is a non-proprietary language that no single company can control.

The ECMA committee has recently accepted two new specifications. These are the Standard ECMA-334: C# Language Specification and the Standard ECMA-335: Common Language Infrastructure (CLI) Specification. I took a quick look at these.

The acceptance of ECMA-334 is the approval of the third edition of the C# language. This standard specifies the syntax and constraints used to create a standard C# program. Additionally, it defines the semantic rules for interpreting C# programs and the restrictions and limits that must be met to be considered a conforming version of C#.

More specifically, what does this mean to a C# developer? It means that a number of new features can be used with confidence because future C# compilers will be supporting them. These features include:

  • Pragma directives
  • Anonymous methods
  • Static classes
  • Partial declarations (article)
  • Property get and set accessors
  • Generic types and methods (article)
  • Iterators
  • Nullable types

With the changes that have been made to the C# language, it is also not surprising that changes also needed to be made within the standardized CLI specification. Changes in the CLI based on ECMA-335 are:

  • Support for generic types and methods.
  • Additional prefixes of constrained., no., and readonly.
  • Additional instructions of Idelem, stelem, and unbox.any.
  • Added a number of members and types to the Type library.
  • Made changes to the specification including the addition of a "Debug Interchange Format" section.

In the CLI, there are numerous types and members that were added to the type library. These include a number of generics in the System namespace ranging from Action<T> to TypedReference. The System.Collections.Generics namespace was also added along with numerous types within it. The System.Reflection namespace was updated to allow for support of generics reflection as well to include new enumeration values to support non-standard encoding of String formatting attributes. The System.Runtime.CompilerServices namespace was updated to include types CompilationRelaxations and CompilationRelaxationsAttribute. Finally, the System.Threading.Parallel namespace now contains a number of new types for supporting multithreaded CPUs.

As you can see, C# and the .NET Framework are evolving. These new additions help to boost C# into being an even more powerful, non-proprietary, standardized language. Although Microsoft may be initiating the changes, it is good to know that a standards board is controlling the language. In my opinion, this gives C# developers some added protection as the C# language continues to evolve.

# # #



About the Author

Bradley Jones

Bradley Jones, in addition to managing CodeGuru, Brad! oversees the Developer.com Newtwork of sites including Codeguru, Developer.com, DevX, VBForums, and over a dozen more with a focus on software development and database technologies. His experience includes development in C, C++, VB, some Java, C#, ASP, COBOL, and more as well as having been a developer, consultant, analyst, lead, and much more. His recent books include Teach Yourself the C# Language in 21 Days, Web 2.0 Heroes, and Windows Live Essentials and Services.
Google+ Profile | Linked-In Profile | Facebook Page

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: March 27, 2014 Teams need to deliver quality software faster and need integrated agile planning, task tracking, source control, auto deploy with continuous builds and a configurable process to adapt to the way you work. Rational Team Concert and DevOps Services (JazzHub) have everything you need to build great software, integrated seamlessly together right out of the box or available immediately in the cloud. And with the Rational Team Concert Client, you can connect your …

  • As businesses have grown in size and global reach, emerging technologies such as cloud computing and virtualization have appeared to help companies effectively connect and grow. However, the networking strategies and infrastructures that keep organizations connected have often remained in the past. Now, new strategies that leverage global connectivity and locations exist to provide a more flexible and cost-effective alternative to traditional networking systems. This Aberdeen report analyzes how top performing …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds