Is C# becoming a functional language?
With the extensive functionality added to support LINQ, many people have been asking if C# and VB are becoming functional languages. Mads Torgersen, C# Language PM, answers this question in his article by the same name.
The first area he addresses is expression-orientated constructors. By allowing any property to be set in the constructor, developers can easily compose nested constructors. Currently the class's author has to guess which properties the developer may want to set during initialization, and without optional parameters, these lists could become quite long.
The next area is value-based programming, an area that Mads admits C# is still weak in. While writing immutable types is possible, there is some overhead such as manually overloading the hash code and equality operators.
With anonymous types, C# and VB get one-step closer to true dynamic typing. They are not there yet, but at least you do not have to create so many trivial classes.
Pattern matching and tuples are two more areas that you will not be seeing in C# any time soon. You will however see extended support for C#'s anonymous functions and lambda expressions. There is even a way to curry functions, though as Mads says, "it ain’t pretty".
Finally, C# will support type inference. Besides making anonymous types possible, type inference can significantly reduce the amount of redundant code a developer has to write. This is one reason why dynamic typing has been praised so much recently. But unlike true dynamic typing, the compiler still outputs statically checked early bound code.
leading over java
by
Joost de Vries
Hopefully java will follow.
I never realized that Microsofts interest in functional programming is tied to the usefulness of functional programming in parrallel programming. The multicores are coming...
Re: leading over java
by
Jonathan Allen
You can also watch for more PLINQ articles from InfoQ at www.infoq.com/PLINQ/.
Thoughts about Java, C# future and functional relationships
by
Dominique De Vito
And into another post, more ramblings on programming languages, I have tried too to give more thoughts about this move, and reasons why such "exotic" languages, like functional languages, have NO intrinsic performance problems.
Educational Content
Tuning the Size of Your Thread Pool
Kirk Pepperdine May 23, 2013
Co-making Great Products
Jeff Patton May 22, 2013




Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think