Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How difficult is it to learn F# for experienced C# 3.0 developers?

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#?

like image 418
Marcel Lamothe Avatar asked May 28 '09 02:05

Marcel Lamothe


People also ask

Why is the F chord so difficult?

One of the reasons the F chord is difficult to play is because it's positioned on the 1st fret of your guitar. A good rule of thumb to remember is as follows: the lower the fret, the higher the string tension. It takes tremendous finger strength to barre across the first fret.

How long does it take to learn F?

Just keep practicing the transitions to the F chord, do this for at least 10 minutes a day, and you should be able to switch to it smoothly within a month. F is the hardest, like people have said it's right by the nut so it's harder to fret.

Is key of F hard for guitar?

The F barre chord is really one of the first major challenges you'll experience as a guitar player. Of the “first position” Major chords, it's likely the hardest to play. But there's an easier version of this chord. There's no barring required and it sounds great.


2 Answers

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

  • http://codemiscellany.blogspot.com/search/label/f%23 (credit to Perpetualcoder)
like image 103
Jamie Penney Avatar answered Sep 20 '22 23:09

Jamie Penney


For me, one of the more difficult parts was really learning algebraic data types (discriminated unions and tuples) and pattern matching, since I had really not deeply encountered these concepts in other languages.

As for getting up to speed, here is my favorite online content for learning F#. Since you're coming from C#, you may find 'what does this C# code look like in F#' useful.

like image 22
Brian Avatar answered Sep 20 '22 23:09

Brian