C# is a great imperative OO language on the .Net platform. It really is. I’ve used it since day one and I’ve seen it grow with new features continually added, most of which brought great benefit. Now though, I’m concerned. With functional programming, though not yet mainstream, entering the thoughts of more and more enterprise developers, there seems to be an obsession within the C# compiler team to add more functional features to the language. I for one, don’t understand why.
The application development community seems to understand reasonably well that there’s a fine line between simplicity and complexity and it pays to stay on the simple side where possible because nothing is free and you will have to pay for that complexity one way or another. Sometimes, as the saying goes, less is more. From afar though that advise seems to be largely ignored with those responsible for the direction of C# within Microsoft.
Let’s be clear, despite functional-style additions such as LINQ which really did bring a lot of benefit, C# is not a functional language. It doesn’t really support immutability, is largely statement based rather than expression based, and whilst with LINQ you can do function currying and partial application of sorts if you try hard enough, would you really want to? It’s not exactly easy on the eye.
The big question for me is why try to bring more half-baked functional ideas to the language as has been suggested with C# 6.0 at the risk of making it complex for all, and worse, giving more tools/ammunition to the plethora of “developers”who have no interest in programming as a craft but merely banging out one mess after another that some other poor soul will have to pick up and pick apart?
C# doesn’t need to change drastically in my view. It’s great at what it does now without needing to bastardize it and potentially ruin it. I’d even wager that most C# developers are not even aware of (never mind, might need) functional programming so why try to force it on them? For those that do need or want functional features they know who they are, and they’re perfectly aware that C# is not the right tool for the functional job. They also know that there’s a perfectly good language already available for functional programming, and it too comes from Microsoft. It’s called F# and what a fantastic functional programming language it is too! Yes, it’s a hybrid, imperative, OO and functional language but at least it was designed that way from the ground up.
Instead of trying to blur the line and make a “one size fits all”, jack of all trades – master of none language, Microsoft should just leave C# alone and trust developers to make the right choice when the time comes. Functional isn’t for everybody – yet.