|
|
YOUR FEEDBACK
|
TOP MICROSOFT .NET LINKS .NET News Desk
The Father of C# Improves His Brainchild
By: Derek Ferguson
Digg This!
(November 20, 2002) - Anders Hejlsberg delivered a speech to the attendees of the recent OOPSLA conference in Seattle in which he described four new features to be incorporated into the C# programming language. These were: generics, Iierators, anonymous methods, and partial types. Generics is a technology developed largely by Don Syme and Andrew Kennedy of Microsoft Research. Similar to C++ Templates, generics are much more powerful. For example, in C#, developers will be able to restrict the types of the "wildcards" used to concretize their generics, which is impossible when using Templates under C++. Iterators are being added to solve a usability problem with the C# language as it currently stands. Specifically, in order to use the foreach keyword under C# now, developers have to make their objects implement the IEnumerable interface. Unfortunately, this is a rather cumbersome interface to implement. Going forward, developers will be able to implement an iterator that will allow the use of the foreach keyword simply by adding a method with the following signature to their class: public Object foreach() The third language alteration - which nearly produced a standing ovation from the assembled crowd - was the addition of so-called "anonymous methods." This is a step in the direction of Java's "anonymous classes," which allow entire bits of functionality to be defined at their point of use without even being given a name for later reference. Hejlsberg indicated later (during an exclusive .NETDJ interview) that he feels that this kind of behavior might not always lead to the most truly object-oriented of designs. Finally, partial types will be introduced to change the existing one-to-many relationship between C# source files and classes into a many-to-many relationship. What is the practical value of this, you might ask? It allows a single class to be defined in multiple files that may then be created and managed via different entities. For example, an automated code generation tool might be responsible for creating the parts of a class dealing with the user interface, while the human-generated code for this class is all kept safely in another file. In this way, classes can be safely "round-tripped" between generators and human beings with far less danger of accidental code overwrite. For more information on C#, see www.csharp.net.
MICROSOFT .NET LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
||||||||||||||||||||||||||||||||||||||