The A-Z of Programming Languages: C#

Microsoft's Anders Hejlsberg reveals the history behind one of the most common programming languages, C#, and what the future holds for C#4.0.

Anders Hejlsberg

Anders Hejlsberg

And I guess they couldn’t have done that had you not put the specifications out there?

Well, they could have but it would have been a heck of a lot harder and it would probably not be as good a product. You can go reverse engineer it… they have reverse engineered a lot of the .NET platform… but all of the core semantics of the language, they were part of the standardization process.

You know most recently we’ve created Silverlight, which is our browser hosted .NET runtime environment, and the Mono guys have built a project called Moonlight which is an implementation of Silverlight that is officially sanctioned by Microsoft that runs on Linux and other browsers. It’s a good thing.

So to focus more specifically on C#, why did you decide to introduce boxing & unboxing into the language?

I may have even touched on that a little bit earlier. What it boils down to is the fact that boxing allows you to unify the type system, and what I mean by unify is that when you are learning C# or approaching the language for the first time, you can make the simple statement that ‘in this language, everything is an object.’ Any piece of data you have you can treat as an object and assign it to a variable type object. The mechanism that makes that work is boxing and unboxing.

If you look at a similar language such as Java, it has a divided type system where everything is an object except ints and bools and characters etc which are not objects. So you have to sort of immediately dive in and describe the finer distinctions between these classes and types. Whereas when you have a unified type system you can just treat them as objects and then later, if you care, you can start diving into the deeper details about value types vs. reference types and what the mechanics are about and so forth.

We’ve seen this many times as people that teach the language have come back and said this is great as it allows us to have a very simple starting point. So from a pedagogical standpoint, it flows much better to first say that everything is an object and later we’ll teach you about the different kinds of objects that the system has.

Did you intend to make it easy to teach, or was that simply a side effect of the way the language was designed?

I’d say we kept teachability in mind. It’s not just teachability that is an advantage of a unified type system, but it also allows your programs to have fewer special cases etc. I would say the motivator here was more conceptual simplicity. But conceptual simplicity is generally a great thing when it comes to teachability so the two kind of go hand in hand.

How do you feel about C#3.0? Were you happy with the release? When is the next release due out?

Yes, I’m very happy with it, I think in some ways C# 3.0 was our first chance to truly do innovation and something brand new in the language. C# 1.0, if you think about it, was like ‘let’s go from zero to somewhere, so lets build all of the core things that a programming language has to have’. So, in a sense, ‘let’s build the 90% that is already known in the world out there’. C# 2.0 was about doing all of the things we wanted to do in C# 1.0 but we knew we weren’t going to have time to do. So C# 3.0 was the first chance of a green field: ok, what big problem are we going to attack here?

The problem we chose to attack was the mismatch between databases and general purpose programming languages, and the lack of queries and more declarative styles of programming in general purpose programming languages. It was a fantastic voyage, and it was so much fun to work on. The result has been quite unique and quite good really. LINQ is something that is a new thing.

Do you expect C#3.0 to become an ECMA and ISO standard, as previous versions have?

We’re certainly open to that. There’s no ongoing work in the standards committee at the moment, but it’s really more a question of whether the community of industry partners out there would like to continue with that process. I should also say that the standards for C# explicitly do permit implementers to have extensions to the language, so though C# 3.0 is not standardized, it is certainly a complete implementation of the C# 2.0 standard. It is 100% backwards compatible, as all versions are.

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags a-z of programming languagesf#C#C

More about ATLBorland AustraliaECMAINQISOLinuxMacsMicrosoftNUObject Oriented

Show Comments