views:

895

answers:

8

Possible Duplicate:
F# - What are you using it for?

There are some nice tutorials around, but what I'm wondering is, is it worth learning it if you are already good at C#? How will it make development easier, quicker, or just better? If it is the case that it is better for a subset of project types, please could you give some examples?

The justification for F# is something that is not much discussed on the web.

+9  A: 

Is it worth learning ? From my perspective, yes. But my perspective is different from yours!

I work with people who develop financial models on the .NET platform. A functional language works well for (amongst other applications) financial and mathematical models due to conciseness and facilities like ease of recursion. Additionally, since most everything is immutable, we can multithread very easily with little grief. Finally, we have access to the common .NET runtime objects that are already available in C#.

If you're already au fait with the .NET platform, adding a functional language to your armoury will be most useful. It will give you a different perspective on problem solving, and you can integrate your C#/F# solutions together trivially.

Note: Since I'm a Java programmer, I'm trying to do the equivalent with Java (the language) and Scala (a functional language that runs on the same Java virtual machine).

Brian Agnew
+3  A: 

According to this reddit discussion, F# is used a lot on Wall Street.

Nemanja Trifunovic
+5  A: 

You may want to check out Chris' blog/talk:

http://blogs.msdn.com/chrsmith/archive/2009/08/20/f-for-architects-hitting-the-sweet-spot.aspx

...So this talk is about removing some of the excitement associated with your typical F# talk and just deal in facts. My goal isn’t to convince you to start programming in F#, but instead articulate what the language is good at so you can decide for yourself if F# is worth looking into...

Brian
+3  A: 

F# is a (mostly) functional language. The advantage of functional languages is that proving the correctness of an implemented algorithm is much easier than with procedural languages (with procedural languages it is often an overwhelming task; note that I'm saying proof in the strict mathematical sense).

In other words, programs written in functional languages can be more reliable, or proven to be reliable.

Tamás Szelei
+3  A: 

Check this video: An Introduction to Microsoft F#, by Luca Bolognese on PDC 2008. It's perfect introduction to F# and it shows basic differences and similarities between F# and C#.

zendar
+2  A: 

I firmly believe that learning any functional programming language will boost your skill as a programmer. Since you're already comfortable with C#, learning F# will be made easier because you already recognize the .Net part of the language. You can even integrate components built with F# into other .Net projects.

Before I started learning F#, I was only able to think step-by-step. As I became more proficient at functional thinking, you could say that I became enlightened (hmm. this may sound a bit over the top, but it's true).

Working with immutable lists, for example, really boosted my understanding of recursive programming; something I never really thought about before. Working with list comprehensions and map/filter operations greatly helped me understand the principles behind LINQ.

I unfortunately can't use F# in team projects, but the ease with which I can now use/understand LINQ and other functional programming concepts aids my C# development.

I also used F# to build prototypes: F# interactive was a great help here. I've built and tested an algorithm piece by piece in F# and ported it to javascript later. Thinking about having to build it in javascript from scratch makes me shudder.

Short version: learn it. It will warp your mind (in a good way).

cfern
A: 

I like to look at F# the same way as I look at Ruby - does it do solve anything particular for me? No. Is it fun? Yes. Can I do the same things I am already doing in a nice way? Yes, kind of. Does it make my days happier? Yes.

I really liked the speech on this at PDC2008 by Luca Bolognese.

Tubbe
A: 

As I answered here :

F# has a complete (almost?) superset of C# functionality, so you'll lose nothing (apart from some of the designer support). F# works with OO; it does not necesarily force you to use a functional approach to everything. Indeed, F# encourages you to use imperative/OO style when convenient.

So, at worst, F# for a die-hard C# programmer is just going to mean lighter syntax. But more probably, you'll end up with simpler, easier solutions. You can apply some of the techniques to C# too, if you decide not to use F#. And best, you'll probably have fun.

...

MichaelGG

related questions