I’ve been doing a lot of reading lately, and lot of it has been about functional programming. There are many well known writers out there with quite a bit to say on the topic. For example, Steve Yegge and Paul Graham talk about the virtues of functional languages a lot. What I don’t understand is why neither has even once mentioned C# 3.0. They and many others talk a lot about Ruby, and how important functional programming is there, and they are right. But I can’t understand how someone who values functional programming so much can ignore the functional features in C# 3.0. Sure, they might like Ruby more, but when Microsoft releases C# 3.0, functional programming will finally be mainstream in a way that Ruby would take years to reach. And for an advocate of functional programming, that should be an event of astounding importance. But not one single mention of it is made on either site, or many others that advocate LISP, ML, Hakell, OCaml, etc. Will C# 3.0 do everything these languages do? No, but I think it hits the most important points, at least as in the area of functional programming. Why do these writers completely fail to mention such a momentous turn of events for one of their most dear principles? I can only conclude it is a hatred of Microsoft, which causes them to think irrationally when it comes to anything from Microsoft. If it was just a few writers, this wouldn’t trouble me so much, but it’s not just a few writers. I see so many people who will simply pretend as all Microsoft’s products with less than 90% market share are insignificant. I expect the reaction will be different when Sun announces that they intend to support functional programming in Java as well. I’m not sure when it will happen but I am sure they are thinking about it. If you look at the specs for the pluggable annotation API closely, it talks “new language features”, and visitor classes. This can only mean one thing, lambda functions with closures. Of course, unless Sun is being very tight lipped about this support, Microsoft will beat them to the punch. It’s unlikely that Sun is hiding anything because the JCP process does not really allow for that. It’s nice to see that Sun has woken up, and isn’t ignoring what .NET is doing, as they once did. J2SE5 was a litany of copycat features, for which I applaud Sun, rather than deride them. And of course, functional programming in general is a copycat of what LISP did long ago. But that’s ok, because with programming languages it’s not all about which language was first. We programmers are more practical than that.. Aren’t we?
Sunday, August 13, 2006
Functional Programming in Java, C#, VB.NET? Soon.
Labels:
.NET,
general programming,
java,
language design
Subscribe to:
Post Comments (Atom)
4 comments:
People may ignore C# not because of hatred of Microsoft but because C# in many ways sucks compared to Ruby, Python, Haskell, Lisp or OCaml. Even if 90% of programmers use C# (which they don't), it doesn't mean everybody should take interest in the language.
Agreed, I've seen an example combining generics, lambda expressions, extension methods, and reflection - it's getting too complex and the language is becoming less and less readable. I've seen a post claimed that the language will be replaced by something simpler sooner than we think.
The two standard responses to technology superior to that which you are emotionally and religiously attached:
1. It sucks, mines better (absent explanation or examples)
2. Ummm, all the power makes it too complex.
Riiiight.
Ryan I have been reading your blog for a little while now and it seems you and I agree on a variety of topics. From the role of the toolset in programmer productivity, to software patents, to energy issues.
I am mystified by all the noise and hype about Ruby and Python. I'm competent in both of these languages (as well as a host of others) and none of them compare to C# 3.0 as functional programming languages. Monads, composable queries, lazy evaluation, and the ability to morph code into data. The last feature is remarkably close to LISP's macro abilities, enabling for much more interesting and powerful metaprogramming scenarios than either Ruby or Python.
We should correspond. I've just started a blog at themechanicalbride.blogspot.com where I discuss LINQ. I'd be very interested to hear your feedback.
I don't think it has to do with lack of quality of C# or hatred of Microsoft. It has to do with the fact that C# is so tightly tied to the Windows operating system.
Jeff
http://artfulcode.nfshost.com
Post a Comment