Welcome to F# Weekly, A roundup of F# content from this past week: News What’s new in .NET 9 ASP.NET Core updates in .NET 9 Preview 1 .NET 9 Preview 1 – February 13, 2024 Our Vision for…
I've not seen any F# commenters here, but I have a question in case any lurk.
In short: does F# still have a major differentiating vision for the future? I know that most cool C# features were pioneered in F# first, but based on my ~2016 knowledge it has almost run out of features to steal.
For context, I used to love F#. It made C# feel ancient. But now C# has async, tuples, records, switch expressions, basic pattern matching, etc. It's all less elegant, but it's good enough that I can't justify using the less popular language anymore.
My concern is that F# has entered a state of half-success, where it has too many professional users to introduce risky new features, but it no longer has a USP strong enough to gain new ones. I'll be very happy if someone can explain why I'm wrong!
That's true. You can kind of do it Scala style with an interfaces and some classes, but with two big drawbacks: no exhaustiveness checking, and no "object" syntax for defining singleton classes. They seem to be heading in that direction though.
It's main strength doesn't lie in any isolated language features that C# might appropriate, but in the fact that it's a functional-first language. The language itself is designed from the ground up to encourage a programming style that is more logical, concise and modular than OOP. F# code has been proven time and time again to be far more compact and refactorable than C# code on average, and an order of magnitudes less error-prone.
F# is the kind of language that doesn't let you get away with sloppy coding, for better or worse. Not as efficient for quick prototyping as a language like Python, say, especially if you're way more familiar with the OOP paradigm, as most programmers today still are, but if you want reliability and maintainability with access to a vast library, there are few better options (only Scala comes close, I'd argue). This reliability and innate security is one of the reasons why it's relatively popular in the financial sector.