Welcome!

PHP Authors: Salvatore Genovese, Michael Sheehan, RealWire News Distribution

Related Topics: .NET

.NET: Article

.NET Archives: Getting Reacquainted with the Father of C#

Derek Ferguson, Editor-in-Chief of .NET Developer's Journal, Talks to Hejlsberg In a Major Interview

.NETDJ: How have you actually implemented this?

AH:
Specifically, we have a type implemented called "System.Nullable<T>." It combines a type with a flag that indicates whether or not a variable's current value is null. It is itself a Value type. This saves you from having to box and allocate all of your - for example - integers on the Heap. Nullable types allow you to actually store your values and their null-or-not-null flags together as a nice little package.

Above this - in the Base Class Library (BCL) - we have added a bunch of things in the language itself. Just as we have support for strings in the language, now we have supporting features in 2.0 that allow you to do interesting things with nullable types. For example, we have syntax for nullable integers. We have a bunch of conversions from the null literal to nullable types. And, of course, there are conversions between nullable and nonnullable types.

This is all covered in the specification for C# 2.0, which we recently updated on the C# homepage. We put up the complete and (hopefully) final specification for 2.0, whereas we only previously documented the top features.

.NETDJ: The last time we spoke, you had just returned from a sabbatical. I'm guessing that the march to 2.0 hasn't allowed for any of these since then. Is there another long break in your future? If so, what will you do?

AH: No, no - I'm about to go on vacation for a while, but no sabbaticals now.

.NETDJ: What is a typical day-in-the-life of a distinguished engineer at Microsoft? Do you actually have deadlines and reviews and all that sort of stuff?

AH: It depends on which day it is. I get to work at home on Tuesdays and Thursdays. On Mondays, Wednesdays, and Fridays, however, my typical day is lots of meetings. The C# design meetings have run continuously in the same room on these days from 1 p.m. to 3 p.m. for 5 years now. In these meetings, we design current and future releases of C#. Some people have moved out of these meetings and some people have come in, but I've been in all of these ever since the beginning.

I also meet with all of the other groups. I have a function, for example, as an architect for the BCL, so I might meet with them to keep them abreast of everything that is going on with C#.

On Tuesdays and Thursdays - when I work at home - this is my time to read and write code and specifications and do the more research-oriented aspects of my job.

.NETDJ: I know that the J2EE folks are adding parallel functionality for some of the new features that will be in .NET 2.0, such as generics, as well as some features that are already in .NET 1.1, like attributes. I know nothing about how they compare and contrast, though. Could you enlighten us as to how the .NET approach is, to your way of thinking, better?

AH: Well, so... the Java 1.5 release will have generics and - I'm not sure if the design is finalized - it appears to be the case that their generics implementation is based on the premise that the VM cannot be modified; code must run on an unmodified VM. The compilers will erase the "genericity" at runtime and substitute the root object types of your object parameters. Unfortunately, this limits how far you can go. You don't get "genericity" over value types, so you can't have a list of integers, for example - only lists of reference types.

.NETDJ: Why is this important?

AH: You wouldn't get any efficiency from using generics with primitive types. When you take things out of a list of a certain type, for example, the compiler needs to insert type casts. Nonetheless, they still incur the overhead that they always did at runtime, so you don't get any execution efficiencies from using generics in J2EE.

The other thing is more subtle, but more important. When you erase type information at compile time, you don't have faithful reflection at runtime. So, you wind up with fewer features available. The industry is relying more and more on dynamic code generation, so it is more important that we have faithful type representations at runtime. In .NET, you can go to any object at runtime and ask it what its type is. For example, with generics in .NET 2.0, I can actually go ahead and understand that I am holding a list of integers. In Java's "erased world," I only know that I have a list - I have no idea what is in the list.

It also looks like Java 1.5 will have a bunch of features that we have always had: a foreach-kind-of-thing (they can't add new keywords) - Enums, extensible metadata (what we call attributes), and a few more. There is some cross-pollination going on and that's great! Certainly, there was cross-pollination going on in the opposite direction when we started .NET.

.NETDJ: Where does the ECMA standardization process stand for C# - current features and new?

AH: At this point, we have submitted all 2.0 specifications to ECMA. The last one we submitted was nullable types about a month or two ago. There are a few more ECMA meetings before this fall when ECMA is set to vote on C# 2.0. As we did with C# 1.0, we have submitted every specification that covers the language in complete detail. Of course, we only have one vote so I can't say with certainty when this will become a standard, but it is moving forward nicely.

(continued on page 3)

More Stories By Derek Ferguson

Derek Ferguson, founding editor and editor-in-chief of .Net Developer's Journal, is a noted technology expert and former Microsoft MVP.

Comments (10) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
isodoor 10/26/09 03:54:00 AM EDT

Professor Linda Shapiro is a great women with the following honors:
1. Pattern Recognition Society Best Paper, 1984
2. Pattern Recognition Society Honorable Mention, 1985
3. Pattern Recognition Society Honorable Mention, 1987
4. Pattern Recognition Society Best Paper, 1989
5. Pattern Recognition Society Best Paper, 1995
6. Fellow of the IEEE, 1996
7. Fellow of the IAPR, 2000
I like this site ;)
Good post thanks for sharing.

Peter Frost 01/28/08 06:21:14 AM EST

So it was the flaws in most major programming languages (e.g. C++, Java, Smalltalk, even Delphi) that drove the fundamentals of the CLR, which, in turn, drove the design of the C# programming language itself? Interesting...

David Totzke 03/14/05 12:27:22 PM EST

The mothers of C# invention wrote:

"Or you might actually look beyond the blinders and see that VB is Basic mutated beyond recognition. And Basic was the worlds only programming language for those who couldn't program. "

Thank god for that. Now all of the people who couldn't program won't be able to inflict their garbage on the world.

"The father of C#! Like calling the guys in Malasia and China running the illegal CD and DVD duplication operations the fathers of multi-media. "

Well, at least they're not bitter. Somebody get the mothers some Thorazine please.

Sheesh,
dave

The Mothers of C# Invention 03/12/05 09:59:57 PM EST

>I think there is a healthy cross-pollination that occurs
>between all the programming languages. While you might see C#
>pioneer in one direction and VB pioneer another, ultimately
>there is a lot of crossing over of ideas over time.
>Certainly, anything we do on the C# team we let the VB folks
>participate in and vice versa.

Or you might actually look beyond the blinders and see that VB is Basic mutated beyond recognition. And Basic was the worlds only programming language for those who couldn't program.

Or if you took the blinders off, you might see that C# is Java with Microsoft curb feelers.

J++ + MFC ??? What a joke! Microsoft never saw a standard they couldn't improve upon!

The father of C#! Like calling the guys in Malasia and China running the illegal CD and DVD duplication operations the fathers of multi-media.

Doug Ferguson 03/11/05 03:45:29 PM EST

What should the language/framework add in the future?

Managed Threading would be a great addition. Currently managed memory stops the wild pointer problems that we see in unmanaged C/C++. The GC manages the memory.

However, when programming with threads, it is so easy to make a mistake. What is worse is that you will not know that you have made a mistake until some random collision blows up your program.

Managed Threading would check for thread safety in addition to type safety.

With all the announcements about dual core processors, multi-threading issues will be more important than ever.

dotnetRajesh 02/18/05 09:31:57 AM EST

Fantastic interview.Thanks.

Mukul Gandhi 02/11/05 11:41:32 PM EST

Its indeed inspiring to read interview of Mr. Anders Hejlsberg.

I have heard that Microsoft has decided not to implement latest version of XSLT language(XSLT 2.0) and XPath (XPath 2.0) in the .NET Framework. But Microsoft wishes to implement XQuery 1.0 in .NET, but only after it becomes a W3C recommendation.

In this interview, Mr. Anders Hejlsberg has said.. "Another language that is difficult to learn, but very powerful, is XSLT". It therefore seems, XSLT is an important language for Microsoft!

I wish Microsoft implements XSLT 2.0, XPath 2.0 and XQuery 1.0 in .NET Framework(and other relevant products).

Also it seems, Microsoft has decided not to release next version of their freeware MSXML software(i.e. after MSXML4, which I think is MSXML5). MSXML5 is shipping only with MS Office 2003. I wish Microsoft release its latest MSXML5 software(or later versions like MSXML6..) as freeware just like MSXML4. And, latest MSXML (6 and beyond), should support XSLT 2.0 and XPath 2.0!

I have heard, that Microsoft is of the view, that they implement W3C specs only after they become recommendations(and not in draft form).. I do agree with this view.. But, if Microsoft starts work now(it might have already started!), to implement XSLT 2.0/XPath 2.0 in .NET and MSXML, the product would be delivered on time!

Regards,
Mukul