F# is one of the best languages on the market to date, for just about any measurement of best.
It’s functional. It has killer tooling — some of the best in the business. It’s statically typed. It’s pretty fast. And when it isn’t fast enough, it has a simple mechanism for invoking speedy, unmanaged code. It has access to the massive number of useful libraries in the .NET ecosystem… The list goes on.
So why isn’t it more popular?
And just for the record, it isn’t very popular. Let’s take a look at the job market, shall we? How does F# stack up against its functional competitors?
From Indeed trends: http://www.indeed.com/jobtrends/q-F%23-q-Scala-q-Haskell-q-Elixir-q-Clojure.html
F# is the little blue line at the bottom. Barely a blip.
And against Java/C#? Fuggedaboudit.
Why is that?
I think the problem is that F# is a .NET language. “But wait,” you say, “Didn’t you list .NET as a /benefit/ of F#?” Yeah, I did. But it’s also the problem.
With F#, Microsoft created one of the best languages available and then quietly placed it on the shelf. They continued to put all of their muscle behind C#. And C# is a pretty good language. Much better than Java. Scala has achieved its moderate popularity due to the suckiness of Java. C#, on the other hand, generally ends up assimilating the best ideas from other languages. That means, if F# does something better today, just wait a bit, and C# will eventually do it, too.
F# is better. Much better, in my opinion. Just a few reasons: automatic currying, excellent pattern matching, way more terse, far better type inference…
But C# is painless enough that most .NET developers just won’t bother shopping for a better alternative.
A bit of context is in store, here. I was a .NET (mostly C#) developer for 15 years before my stint as a Front End Engineering teacher and my current (Rails) gig. I loved Visual Studio. I loved C#. And I honestly found Microsoft to be mostly tolerable. I even worked there for a bit.
That said, I hated the .NET ecosystem. Get a job at a .NET shop, and you’ve got a 99% guarantee that you’ll have only one choice of technology — whatever Microsoft is peddling. Why the eff is the SharePoint monster still eating small children? Because Microsoft shops follow the herd more than any other group of developers I’ve met. “Microsoft says we should use this. Therefore, we’re gonna use this.”
Got a super speedy ORM? Who cares. Microsoft says to use Entity Framework.
Got a superior platform for realtime distributed messaging? Tough beans. Microsoft says to use some flabby messaging system they sell for only $50K per license.
F#, on the other hand, has been open source for a long time. It has been counter-cultural from the start. It has always eschewed the Microsoft way in favor of whatever way seems best. Sometimes, that *is* the Microsoft way. Often it isn’t. If a Microsoft shop’s culture is oil, F# is water.
I think within five years or so, functional-first programming will be the norm. But right now, Java/C# still rule the roost.
F# was introduced before functional programming started really trending upwards. I think that hurt its chances. If it had been released this year (2016) as a hot new cross-platform language, I think it would have garnered more interest. This is especially true if Microsoft would have said, “This is our new, dominant language.” the way Apple did with Swift.
Microsoft is opening up a whole lot more than I ever would have dreamt. Who would have predicted that in 2016 ASP.NET would be open source and Service Stack would be closed source? Cray cray.
Functional programming is inching its way towards the mainstream (React/Redux, Scala, Elixir, Clojure…).
If these trends continue, F# may yet see the limelight.
Despite it’s merit, F# hasn’t become the dominant .NET language. Environmental and cultural issues are to blame. It’s time for a bottom-up change. If you work at a .NET shop, you owe it to yourself to check out F#. If you like it — and I think you will — you should promote it internally as much as possible.
Do it. You won’t regret it.