Feeds

Anders Heljsberg on what's next for C#

Pointers not considered harmful

  • alert
  • submit to reddit

Build a business case: developing custom apps

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

Build a business case: developing custom apps

More from The Register

next story
iPad? More like iFAD: We reveal why Apple fell into IBM's arms
But never fear fanbois, you're still lapping up iPhones, Macs
Sonos AXES support for Apple's iOS4 and 5
Want to use your iThing? You can't - it's too old
Amazon says Hachette should lower ebook prices, pay authors more
Oh yeah ... and a 30% cut for Amazon to seal the deal
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
Joe Average isn't worth $10 a year to Mark Zuckerberg
The Social Network deflates the PC resurgence with mobile-only usage prediction
Chips are down at Broadcom: Thousands of workers laid off
Cellphone baseband device biz shuttered
Feel free to BONK on the TUBE, says Transport for London
Plus: Almost NOBODY uses pay-by-bonk on buses - Visa
Nintend-OH NO! Sorry, Mario – your profits are in another castle
Red-hatted mascot, red-colored logo, red-stained finance books
Twitch rich as Google flicks $1bn hitch switch, claims snitch
Gameplay streaming biz and search king refuse to deny fresh gobble rumors
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
prev story

Whitepapers

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.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.
The Essential Guide to IT Transformation
ServiceNow discusses three IT transformations that can help CIO's automate IT services to transform IT and the enterprise.
Maximize storage efficiency across the enterprise
The HP StoreOnce backup solution offers highly flexible, centrally managed, and highly efficient data protection for any enterprise.