| By Derek Ferguson | Article Rating: |
|
| February 20, 2008 02:15 PM EST | Reads: |
72,941 |
.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)
Published February 20, 2008 Reads 72,941
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
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.
![]() |
isodoor 10/26/09 03:54:00 AM EDT | |||
Professor Linda Shapiro is a great women with the following honors: |
||||
![]() |
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, |
||||
![]() |
The Mothers of C# Invention 03/12/05 09:59:57 PM EST | |||
>I think there is a healthy cross-pollination that occurs 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, |
||||
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Adobe Flex Developer Earns $100K in New York City
- Move Over BI, Here Comes PI - Performance Intelligence
- Yahoo! Query Language
- RothmanResearch.com Market Review and Company Analysis on FULT, DISH, ASBC, CTRP, FSLR and CRBC
- Qt DevDays 2009 - Munich
- The Time Is Right for Enterprise Cloud Computing
- Microsoft Nudges Eclipse Developers to Windows-Ware
- Who Invented Virtualization?
- ExaGrid Sets New Standard in Backup Price, Performance and Capacity with Launch of EX10000E Disk Backup System with Data Deduplication and Expanded 100TB GRID Capacity
- Smearing Cloud Lipstick on a Legacy Tech Pig
- Moving the Operating System & Desktop to the Cloud
- 1st Annual Government IT Conference & Expo: Themes & Topics
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Is Microsoft as Free as Open Source?
- Adobe Flex Developer Earns $100K in New York City
- The Curious Case of Build Release Management eBook
- IBM, Microsoft, Others in Lock-Picking Cloud API Push
- Move Over BI, Here Comes PI - Performance Intelligence
- United Planet offers practical portal building tips for SMBs
- Yahoo! Query Language
- RothmanResearch.com Market Review and Company Analysis on FULT, DISH, ASBC, CTRP, FSLR and CRBC
- Qt DevDays 2009 - Munich
- The Time Is Right for Enterprise Cloud Computing
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- The Top 250 Players in the Cloud Computing Ecosystem
- Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
- Ulitzer to Give Drupal 6.0 Its Biggest Scalability Challenge Yet
- An Introduction to Ant
- Appcelerator Named "Platinum Sponsor" of AJAX World Conference & Expo
- "What's New and Exciting About the Web Right Now?" Asks Time Magazine
- Oracle To Keynote Cloud Computing Expo
- First Eclipse Project Targeting PHP Now Available
- AJAX World - Two Great PDF Creators
- C#, Turbo Pascal, C++, PHP...and the LEGO Brick: Denmark's Leading Exports
- Rolling Your Own MVC: The Page Load Scenario
































