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

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • On-demand Event Event Date: October 29, 2014 It's well understood how critical version control is for code. However, its importance to DevOps isn't always recognized. The 2014 DevOps Survey of Practice shows that one of the key predictors of DevOps success is putting all production environment artifacts into version control. In this webcast, Gene Kim discusses these survey findings and shares woeful tales of artifact management gone wrong! Gene also shares examples of how high-performing DevOps …

Most Popular Programming Stories

More for Developers

RSS Feeds