Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am a C# developer, Should I start looking more on F# [duplicate]

Tags:

c#

f#

Possible Duplicate:
What are the benefits of using C# vs F# or F# vs c#?

After reading some on the subject and watching this video http://streaming.ndc2010.no/tcs/?id=29649A14-2F1B-428E-BB12-9A43A1676221 where Eric Lippert, Jon Skeet, Mads Torgersen and Neal Gafter discussing the future of C# its pretty clear that C# has some heavy baggage from earlier features added to C#. These features must be supported in later versions of the language even though they add complexity and makes adding new features more cumbersome. Probably why most languages die sooner or later.

F# is a new language and obviously don't have the same legacy to worry about, so since both are general purpose languages it seems tempting focusing more on F#. Do you think F# is going to take over C# as the language of choice within the .net world and in case how soon will this happen?

I know there is a difference between functional and imperative languages so you could argue they are too different to be compared but the fact that c# is getting more and more functional features I have to ask why not just make the jump directly to F#

like image 744
terjetyl Avatar asked Sep 04 '10 12:09

terjetyl


4 Answers

Firstly, don't think of the division being "functional" vs "statically typed" - F# is still a statically typed language.

Do I think F# is going to take over from C#? Not in many areas. In some niches it will definitely make its mark... but I personally think it's more important for a different reason: it will encourage people to think more functionally.

It's absolutely worth looking closely at F# - in order to improve your C#. You won't find that every task is suited to a functional approach, but it's definitely worth learning to think in a slightly different way.

At this point, I should probably plug Real World Functional Programming - mostly written by Tomas Petricek, with a tiny bit of help from myself. It's aimed precisely at developers who want to think more functionally, with a heavy bias to existing C# developers who are interested in F#. (And today - September 4th 2010 - the ebook is only $15. Use code dotd0904cc at the checkout :)

like image 53
Jon Skeet Avatar answered Nov 11 '22 18:11

Jon Skeet


C# is here to stay. The majority of commercial developers (and almost all commercial .NET developers) are trained in and use C derivative, imperative languages/styles.

I don't think the development world is going to undergo such a radical paradigm shift that imperative OO will vanish in favour of functional hybrids unless of course you count C#'s own move into the realm of a functional hybrid.

(by and large) You just cant hire F# developers, You can't find a job as an F# developer, you can't convince most workaday C#'ers (those who aren't language fans or hobbyist coders in their spare time) that F# is anything more than an academic toy or is simple enough to make it worth their time learning.

I SO wish that wasn't true, the more I learn F#, the more I would love it to be the language I used on a daily basis.

In reply to your question: YES! learn F# as it's a wonderful language, but it's not going to squash C# overnight (or over the next decade).

like image 44
jdoig Avatar answered Nov 11 '22 17:11

jdoig


Should you take a look at F#? Yes, but because F# is an interesting language, and you will learn new things; not because you're playing defense against the chance that "C# is on its way out and F# is the wave of the future". C# is well-established, a great language with a great community and lots of existing assets (tooling, samples, templates, ...) that make it extremely unlikely to be supplanted by any other .NET language in the near future. Learn F# to play offense: to grow your own skillset, and become an overall better developer (even if you still mostly develop in C#).

(Feature creep and legacy do slow languages down some, but not much. From what I gather, C++ is still in use, despite crushing legacy. :) You said that languages die "sooner or later", but I don't recall offhand any language that reached the mainstream but then died "sooner".)

like image 27
Brian Avatar answered Nov 11 '22 18:11

Brian


First of all, F# is a more specialized language than C#. Yes, you could write solutions to almost anything in F#, but you'll find it particularly useful at:

  1. Implementing complex algorithms with lots of transformations
  2. Implementing concurrent algorithms

You won't find F# that powerful at things like UI or DB access (it can be done all right, but you won't find that much a difference from using C#).

Second, I don't think that F# will take over C# overall, but there are certain niche markets (e.g. the financial industry) where F# have a real chance of getting prominent above other languages.

Lastly, the functional programming paradigm, as you yourself mentioned, has made in-roads in several other languages/platforms (Python, Ruby, C#, VB.NET, hopefully the next Java), so getting familiar with its concepts is going to be helpful, and right now, at least in the .NET platform, F# is the truest implementation of such concepts.

like image 1
Édgar Sánchez Gordón Avatar answered Nov 11 '22 19:11

Édgar Sánchez Gordón