Feeds

Anders Heljsberg on what's next for C#

Pointers not considered harmful

  • alert
  • submit to reddit

Top 5 reasons to deploy VMware with Tegile

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

Internet Security Threat Report 2014

More from The Register

next story
Facebook pays INFINITELY MORE UK corp tax than in 2012
Thanks for the £3k, Zuck. Doh! you're IN CREDIT. Guess not
DOUBLE BONK: Testy fanbois catch Apple Pay picking pockets
Users wail as tapcash transactions are duplicated
Happiness economics is bollocks. Oh, UK.gov just adopted it? Er ...
Opportunity doesn't knock; it costs us instead
YARR! Pirates walk the plank: DMCA magnets sink in Google results
Spaffing copyrighted stuff over the web? No search ranking for you
In the next four weeks, 100 people will decide the future of the web
While America tucks into Thanksgiving turkey, the world will be taking over the net
Microsoft EU warns: If you have ties to the US, Feds can get your data
European corps can't afford to get complacent while American Big Biz battles Uncle Sam
prev story

Whitepapers

Choosing cloud Backup services
Demystify how you can address your data protection needs in your small- to medium-sized business and select the best online backup service to meet your needs.
Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.