.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.
About Derek Ferguson Derek Ferguson is an associate director in the Information Technology Group at Bear Stearns, a leading global investment banking, securities, trading, and brokerage firm.
Peter Frost wrote: 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 wrote: 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 wrote: >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 wrote: 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.
Mukul Gandhi wrote: 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...
Corporate raider Carl
Icahn started his proxy
fight for control of
Yahoo this morning,
beginning with the
classic Icahn opening,
the letter of reproach to
the Yahoo board telling
them they have acted
'irrationally and lost
the faith of shareholders
and Microsoft.'
By now it is conventional
wisdom to say that there
was an IBM Era of
computing, then a
Microsoft Era, and now we
are in the Google Era. In
this post, I will explain
why Microsoft was not the
'next IBM' and why Google
is not the 'next
Microsoft' - there are
significant qualitative
diffe
ASP.NET developers are
bored with traditional
books that outline
concepts in a lengthy
way. These books are good
if you like to learn the
features in a detailed
manner. However, by the
time the book is read, a
new version will be
released. Hence, many
learners including myself
prefer s
From Application
Virtualization to Xen, a
round-up of the
virtualization themes &
topics being discussed in
NYC June 23-24, 2008 by
the world-class speaker
faculty at the 3rd
International
Virtualization Conference
& Expo being held by
SYS-CON Events in The
Roosevelt Hotel, in
midtown
'RIA' is slowly fading in
terms of its definition.
When I first started the
RIA Evangelism role in
Microsoft, I had this
nagging feeling that the
term RIA was just all
over the place. Depending
on which technology you
are backing and which
stream of alliance you
uphold, the truth is th
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice: