Ding Ding Ding! We have a winner. Anders Hejlsberg is quite possibly the most clued-in designer of a mainstream programming language. The work that Anders Hejlsberg is doing with C# is amazingly progressive and forward thinking. He’s putting ideas like lambdas, type inference and anonymous classes in a mainstream languages used by armies of programmers. This, to a programming language nerd like myself, is a big deal.
So what’s the motivation behind all this? Well, he started off by saying that data does not equal objects. We’ve got data in XML, databases and all manners of weird files. Thus begat LINQ (Language Integrated Query) which makes querying data a first class citizen in C#. In doing so, you start to insinuate a declarative language inside an imperative one.
During his quick tour of LINQ, Anders made a point to emphasize his idea that “we over-specify the solution” in our programs, leaving little room for the execution infrastructure to do intelligent things. He shows some imperative code for ordering, grouping and filtering data, basically a rats nest of loops and conditionals. Using LINQ he refactors the code down to a simple, albeit SQL-ish query.
Once you’ve declared just the essence of your program to the implementation, it can do clever things to make it go faster. For instance, there’s a parallel version of LINQ in the works. Your average developers gets this “for free” by expressing his queries in LINQ. Thankfully, LINQ is just sugar for a straight-up .NET API, so the younger generation of developers who have never used SQL, let alone @malloc@ can still play. ;)
When he was wrapping up, Anders made a comment that, in the future, they are looking into making languages more like services. I think this is a strategy that they share with Sun – it’s not so much about Java or C# as the interesting runtime bits they ship with. I’m not sure where this idea will go, but I like the sound of it.
Some other great Anders pseudo-quotes:
- Pure Functional programming is fantastic…the only problem is that it doesn’t work for real applications
- Transactional memory is the string theory of computer science
- Dynamic versus static typing is a pendulum that is currently swung towards the dynamic side. The answer is somewhere down the middle. (I think he’s doing a pretty decent job of dragging mainstream languages towards the middle)
- Languages shouldn’t solve a problem until the solutions is known. Otherwise, you just slap a bunch of crap onto your language.
This was my favorite presentation of the week. I’m looking forward to talking to friends who use C# about the clever programming tricks I use every day in Ruby. And it should prove fun to gang up on Java folks too! ;)