Stack OverflowShould Senior Developers learn F#?
[+2] [7]
[2009-10-05 14:08:50]
[ c# f# discussion ]

I've been wanting to learn F#, but I can't see its usefulness (for business purposes) for the following reasons:

  1. Not many people are fluent in F#. If a company implements a business solution in F#, the cost of programmers goes up and the maintainability of the software is curtailed.

  2. C# and F# both generate IL and run on the CLR. Since it all compiles to the CLR, I can't see any reason to write software in F#.

Am I missing something? Or can F# safely be avoided?

I appreciate those that did answer or continue to do so, I'll review the related material found by Benjol and go from there. -
(1) What's funny is that the people that re-opened this question did so even knowing it is an exact duplicate of a number of questions -- and that the author even accepted an answer that pointed out the duplicates. Oh, delicious irony, your name is rebel. - George Stocker
Wow, someone did a great job word-smithing my question ;) Thx! -
[+6] [2009-10-05 14:15:37] Benjol [ACCEPTED]
Sorry I didn't find those when searching; however, thank you for the links they answered my question enough. -
Yeah well, I kind of did the search backwards - I already knew the questions existed, so I just had to work out the shortest search term to get them :) - Benjol
[+5] [2009-10-05 15:02:40] Quibblesome

What is probably more important for an architect is an understanding of some of the aims behind functional programming. This you can gain from reading up on F# or other functional languages such as lisp.

These include concepts such as "purity" which is easily summarised by saying that no shared state is allowed. For parts of an architecture that relies on serious performance (i.e. needs to be parallelizable) or needs to be transactional, "functional style" code should be seriously considered.

-1: Purity is usually seriously bad for performance and, in particular, parallelism. - Jon Harrop
Erm.... don't you mean the opposite or are you being sarcastic? Or perhaps we have different interpretations of purity? By purity I mean no operation has hidden side effects, like the ones you would get in a system with a lot of static and/or global variables or a lot of persistent object references. Parallelism REQUIRES purity to operate. You cannot parallelise something that isn't pure because workerA might affect the work of workerB. Each block of work needs to be pure. - Quibblesome
[+4] [2009-10-05 14:16:42] LBushkin

Learning a new language is not always about finding a practical application for it within your organization. Sometimes, the benefit comes from learning new ways of thinking about solving problems. F#, being a functional language, provides insights into how functional programming techniques can be used to solve certain kinds of problems - and, similarly, where it is not the most effective approach to problem solving.

Such lessons can be transferred to any programming environment - even those that are not purely functional.

[+3] [2009-10-05 16:10:18] Brian
[+2] [2009-10-05 14:18:52] Streklin

F# simply adds another way to express programing related concepts to your arsenal. I suspect you won't have to use them often, but there may be ideas which you may find easier to maintain or represent in F# than C#. If you don't know the technology, if a client asks about it it will be a lot harder to explain why you don't want to use it in the situation at hand.

So in closing - I'd say you should at least learn the basics of F# - enough for you to make a personal decision about whether you could make use of it, or at least explain to clients why you think it doesn't offer the advantages their buzz word reading bosses think it might.

[+2] [2009-10-05 14:15:48] Matt

F# may not find it's way into your mainstream projects at work, but that does not mean it is not worth learning. As a functional language many developers can stand to learn from F# (or any other functional language, really). It provides an interesting perspective on how to code solutions to problems different from a traditional non-functional OO approach. And this knowledge can translate effectively into how to solve problems with your C# in a different (and sometimes better way) using the "functional" features found in C# - such as anonymous functions and lambdas.

[+1] [2009-10-19 11:51:03] IGA

Yes, via Haskell. The concepts are important. I now use them in my C# code. mutable types I never really paid any attention to and thought my code was tight for threading. That is until you look at functional programming and realise that there are holes. Big holes.

I love F# and would like to get more into it on a work front. I must admit that those Object and Classes and the paradigm that has governed the last decade have proven to be a white elephant apart from those inherited bank account examples you see in all books.

Code written in a functional/generic Decomposable fashion is more robust than classes hierarchy.