How difficult is it to learn F# for experienced C# 3.0 developers, and/or what would you say is the most difficult part of learning F#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Starting out in F# (learning the syntax, scraping the surface of how to program in a functional manner) is not too hard. A good C# 3 developer familiar with LINQ and with a solid understanding of Lambda expressions should be able to pick up the basics quickly.
It is hard to say how hard it would be for them to break out the habit of object oriented problem solving, but problems that call for functional solutions should force them to make that leap. It is difficult to change your thinking unless you are presented with a new problem in my opinion.
All in all I would say it took me a week to learn the syntax and basics of the language in my spare time (2-3 hours a night). You’ll need more time than that to get a real feel for functional programming though.
Issues
I am still struggling with types. I have been doing Project Euler problems to teach myself the syntax, so I haven’t needed to any kind of complex user defined types so far.
The type inference the compiler does takes a little getting used to as well, as it is not always clear when it needs types to be specified, and when it can just work them out.
Learning
I would definitely suggest trying Project Euler problems for starters. Mathematical problems are always a good candidate for functional programming.
On a more general note, data processing problems are good too. List processing is very easy in functional languages, and is one of the first things you should learn IMO.
Books
Real-world Functional Programming:
I finished this book a little while ago, and found it really good for working through how to apply functional programming principals to problems using both C# and F#. Most of the examples in the book are done in both languages, using functional programming idioms specific to each language and explaining the difference between them.
Resources