Don Syme in his SPLASH talk says that F# is NOT intended to be a replacement for C# even though it has the general capabilities. He goes on to say that there are areas where F# makes no sense in using, but doesn't expand on the thesis.
- Can somebody please tell me what areas should be avoided while using F# ?
- You could also mention areas where C# shine.
Related question:
In what areas might the use of F# be more appropriate than C#?
Many of Microsoft's UI technologies such as WPF have excellent support for databinding. Effective databinding uses two-way binding to update the underlying objects when the user interacts with the UI. This implies that effective databinding requires mutable objects.
F#, with its emphasis on immutable types, is a pretty poor match to that type of databinding model. While it's possible to create mutable types in F#, doing so would remove a lot of the benefits from the language. It simply makes better sense to use a language (such as C#) where mutability comes more natural.
My take is that replacing a language as rich and mature as C# would be very expensive. So, for example, at the moment, C# is absolutely the best choice for WinForms development if using the Visual Studio WinForms designer can give you an advantage: F# has no WinForms designer.
C# also has better LINQ-to-SQL support at the moment. I'm sure there are many other examples along these lines.
Then there is requiring the entire C# skilled workforce to update their skills to F#, while preserving C# skills for maintaining applications, again expensive.
Finally, C# is an excellent language with a lot of great features, some F# doesn't even have like co/contra variant generics and out of the box support for dynamic programming against the DLR (F# just has an unimplemented operator).
So by not expecting F# to replace C#, F# can evolve in new ways instead of spending all it's time playing catch-up in areas already well-covered.
Good question. I'd say that there are zero language reasons and many unfortunate skill-set, aptitude, and attitude reasons on the part of developers, managers, and customers.
If you're willing to give up tools particular to C#, and pay whatever cost of adoption is applicable, there is no particular area where F# would not be at least as capable as C#.
Web Applications where Frameworks e.g. ASP.NET MVC lend themselves better to C#. "Absolutely no sense" is an extreme, I would say "under normal circumstances."
Of course it could be used for libraries that the web application referenced, but not the actual application itself.
Until f# is fully supported by Visual Studio (ASP.NET, WebForms, WPF, etc) and third party tools, f# will always be a second class citizen.
Let's face it, language choice usually doesn't make much difference to productivity when compared to a solid library (.NET, available to both c# and f# - no advantage to either here), the IDE (intellisense, syntax coloring, etc), (only partially support available to f# as far as I know... e.g. no Razor support), and third party tools (e.g. resharper).
So with that in mind, I don't think anyone can recommend a complete replacement of c# until all of those tools are in place for f#. A good compromise is to use f# in class libraries and continue to use c# on the front end.