Feeds

Anders Heljsberg on what's next for C#

Pointers not considered harmful

  • alert
  • submit to reddit

Mobile application security vulnerability report

According to ancient scriptures, Anders Heljsberg "journeyed to the wilderness, and wept and wailed and cried out unto the Lord, saying: 'Shall I spend the rest of my days tinkering with a Pascal compiler I wrote 15 years ago? Couldn't I have a go at something else?'"

And he did have a go at something else, leading the design for C#.

We caught up with Anders at the launch of Visual Studio DONT [shouldn't that be 'DOT NET?' - pedantic ed.] in San Francisco where he filled us on what he's up to right now, starting with a bit of history on the language.

"We started in January 1999, a really capable design group with four or five of the best people I've ever worked with," he told us. "We met every Monday, Wednesday and Friday and worked all afternoon, going through all the issues that as language designers we needed to work on. Within a year we had a working implementation"

"There's no such thing as a perfect language, You sit in front of a big panel and twiddle all the knobs. You can add more but it becomes less productive. We're pretty happy with the balance."

What came first then, and in terms of the runtime was there already?

"There were the beginnings of the CLR, some of the beginnings of the class libraries"

We asked how the specification C# would avoid getting bloated, an accusation levelled at C++ and Java?

"Yes, it's easier to make the first specification clean, but I'm sympathetic to their plight. But C# was designed as a general purpose language. We're not going to have specific extensions that deal with this or that corner. We'll always try to find a way to implement things in a generic fashion."

According to Anders, generics (parametic polymoprhism) is one of the directions in which C# would evolve. Microsoft already has a prototype of the runtime in generics. "The trick is to proceed with caution," he advises.

He is examining more declarative programming languages. (This was slightly embarrassingly for us - at the time we couldn't remember the name of the best known of the post-Prolog declarative languages, Mercury, which has been recommended to us very warmly, and for which Microsoft is helping develop a .NET back end. Not wanting to refer to "that Australian one" we didn't solicit his opinion on Mercury itself.)

"You've got to get there without taking away the tools people have today. The problem with declarative languages is that they've been domain specific. The trick is finding a combination of declarative and imperative, and that's not impossible."

Imagine, he says, HTML as an imperative language: you'd have to declare a HEAD, then assign a value to t_HEAD, etc.

Six degrees of indirection

We couldn't help asking at what stage in the language design he'd decided that pointers were a necessary evil. Java doesn't support pointers...

"When? That was pretty early on. It all boils down to interoperability and leveraging code you've already written - so many APIs use pointers. That was the concept we had to work with for twenty years.

"So we could sort of look at this in one of two ways - either you have to rewrite everything and make it pure and wonderful, or you can focus on interoperability as a discipline, one that's important to our customers. It gives them ways of making these unsafe operations that are known to be unsafe. So although we support unsafe code in the security model we will never let you execute that code."

"But compared to something like JNI - JNI can get you into a lot of trouble. You can fall off the cliff: you have to remember to pin an object before you can address its data, and, oh my god, you get these random errors"

We asked what the team thought of Miguel de Icaza's desire to move to base GNOME on the .NET frameworks, with his open source Mono project.

"It's great."

David Treadwell, the .NET frameworks manager, predicts that there'd be multiple implementations - although we did point out that the Mono Project's "clean room" approach recommends that developers who've seen the Microsoft "shared source" CLR should not join Mono.

Rather modestly, Anders downplays the design of the language in the bigger scheme of things. After all, he says, learning the API now takes up 97 per cent of the programmer's craft: learning the language takes up three per cent.

This was a group interview, but Peter Monadjemi, a German freelancer filing for Computerwoche, asked a humdinger of a question.

Which was - how did Anders feel about wanting to develop the language, even though such decisions were now in the hands of ECMA, a standards body. You'll have to read Computerwoche to find out his final answer, but for a second he knew what a good question it was, and we knew that he knew, too. ®

Related Stories

Official: Microsoft C# iscool
Microsoft describes its Java killer
Microsoft pulls stealth release of Java for .NET

The Power of One Brief: Top reasons to choose HP BladeSystem

More from The Register

next story
BBC goes offline in MASSIVE COCKUP: Stephen Fry partly muzzled
Auntie tight-lipped as major outage rolls on
iPad? More like iFAD: We reveal why Apple fell into IBM's arms
But never fear fanbois, you're still lapping up iPhones, Macs
Stick a 4K in them: Super high-res TVs are DONE
4,000 pixels is niche now... Don't say we didn't warn you
Amazon Reveals One Weird Trick: A Loss On Almost $20bn In Sales
Investors really hate it: Share price plunge as growth SLOWS in key AWS division
Bose says today is F*** With Dre Day: Beats sued in patent battle
Music gear giant seeks some of that sweet, sweet Apple pie
Philip K Dick 'Nazi alternate reality' story to be made into TV series
Amazon Studios, Ridley Scott firm to produce The Man in the High Castle
There's NOTHING on TV in Europe – American video DOMINATES
Even France's mega subsidies don't stop US content onslaught
You! Pirate! Stop pirating, or we shall admonish you politely. Repeatedly, if necessary
And we shall go about telling people you smell. No, not really
Too many IT conferences to cover? MICROSOFT to the RESCUE!
Yet more word of cuts emerges from Redmond
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Seven Steps to Software Security
Seven practical steps you can begin to take today to secure your applications and prevent the damages a successful cyber-attack can cause.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.