The Register® — Biting the hand that feeds IT

Feeds

C# pulling ahead of Java

Lead architect paints rosy C# picture

Regcast training : Hyper-V 3.0, VM high availability and disaster recovery

C# has come a long way since it emerged from Microsoft's mythical "Project Cool" back in 2000. It is the primary language of Microsoft .NET, and has pulled ahead of Visual Basic among professional Windows programmers.

At last week's Tech-Ed conference in Barcelona, C#'s lead architect Anders Hejlsberg drew large audiences for his sessions on the future of the language.

The big new thing in C# 2.0 was generics. So what's coming in C# 3.0? The headline feature this time is LINQ (Language INtegrated Query), which integrates database query as part of the language.

Why LINQ? "It's effectively to remove the impedance mismatch between a programming language and databases," Hejlsberg said. "The whole concept of query and set transformations is one that really has been missing from general purpose programming languages for no good reason. Why is it that I can query data when it sits in a database but the minute I fetch it into memory I can't query it at all? I can write primitive for loops and if statements, but I have nothing that even approaches the declarative query power that you see in SQL or XQuery?"

LINQ is built on lower-level language features including lambda expressions and expression trees (which allow lambda expressions to be represented as data). Hejlsberg said much of this is borrowed from functional programming. "In C# 3.0 we are looking at a lot of research that has occurred in functional programming languages. Lisp is the classical grandfather of a lot of functional programming, but also Haskell and ML."

When C# first appeared, it looked in some respects uncannily similar to Java. Since then, Java's designers seem to have returned the compliment, with features such as autoboxing (treating simple types as objects) and liberal use of annotations seeming to echo similar features in C#. Are the two languages becoming one and the same?

"If I look at where the innovation is occurring, I would venture to say that we're being a bit more innovative these days than is the case in the Java world," he said. "Java has generics, but they chose to do it in a different way where it's really just compile time sugar that goes away, and they don't in my mind realise all the full benefits of not just a generic language but a generic type system in the runtime. I think we're pulling ahead a bit now by pulling all these functional concepts into C#, and language integrated query is an innovation that is only in C#."

Java on the other hand is cross-platform and is being open sourced. Then again, there is Mono, an open-source implementation of C# and the .NET framework sponsored by Novell. Does Microsoft support or oppose this competition?

"I welcome other implementations, and the Mono guys have participated in the standardisation process in ECMA. We remain committed to the standardisation process with .NET and C#, wherever that may take us."

The trouble is, while this welcome may be true of the language and core runtime, Microsoft's attitude to the non-standardised parts of its Framework, including the popular ASP.NET web platform, is less clear. The recently announced agreement with Novell gives little real comfort, other than to a narrow range of Novell customers, and may even increase the suspicion that Microsoft may one day cause legal problems for Mono. Otherwise, why is there need for a patent agreement? Microsoft needs to do more before cross-platform C# can reach the mainstream. ®

Agentless Backup is Not a Myth

Latest Comments

Backwards compat

God, Microsoft cares more about backward compatibility than any other software company around. I still have win16 programs that run in vista, as well as many made for NT 3.5 and win95. They quit breaking APIs every other version in favor of integrating/bundling everything they could into the OS over a decade ago. The compiler isn't 100% backwards compatible, but they never are from any company/group.

As long as something's made for .net 2.0, it'll continue to work in 2.0 using the 2.0 framework for as long as the framework's around, much like mfc. mfc apps haven't all suddenly stopped working in the last few years because microsoft adopted .net, or tried to cut off wine, have they?

0
0

Open Source it and we have a competitor

The query language built into the language itself sounds excellent. I also share the criticism that Java is too much concerned with backwards JVM compatibility to really improve the language - generics syntax is to horrible that I think it makes things worse rather than better.

The sole reason I am not going to even consider c# for anything is that it is owned by MS, standardization or not, it's all worthless as long as MS owns it.

We must expect the company to do the sensible thing, protect its shareholders interest, and change the language or even just the interpretation or whatever they like on a whim.

This would be bad even if MS didn't have a long history of meddling with the API to benefit themselves and/or hurt competitors. But... it does.

0
0

C# vs VB

> Didn't you forget the question mark in the title?

The title is intended to refer to Anders Hejlsberg's *claim*, but I see your point.

> Also from the Visual Basic programmers I know, it is

> still way more popular that C#.

The piece refers to professional programmers; it's hard to measure such things but C# is consistently and significantly ahead of VB in advertised job vacancies, which is one indicator.

Tim

0
0

More from The Register

Bjarne Again: Hallelujah for C++
Plus: Now officially OK to admit you never used STL algorithms
Interwebs taunt Sir Jony over Apple eye candy makeover
Hey Ive, Ive... add more unicorns, willya?
Nuke plants to rely on PDP-11 code UNTIL 2050!
Programmers and their walking sticks converge in Canada
SCO vs. IBM battle resumes over ownership of Unix
Zombie lawsuit back and wants to suck the brains out of Linux
Red Hat to ditch MySQL for MariaDB in RHEL 7
So long, Oracle! Don't let the door hit you on the way out
Shy? Socially inadequate? Fiddling with your phone could help
App 'tells the brutal truth' about social inadequates' chatup lines
Java EE 7 melds HTML5 with enterprise apps
New release arrives with GlassFish, NetBeans support
 breaking news
'Office Facebook' firm Tibbr wants you to PAY for mobe-meetings app
Great idea. Punters won't cough for it though
 breaking news
The only Waze is Google: Ad giant tipped to gobble map app 'for $1.3bn'
Pac-Man-satnav-ish upstart in bidding war with Apple, Facebook
 breaking news
PM Cameron calls for modern, programmable computers! (We think)
IT education musings to G8 chiefs to mystify IT industry