Myths about F#: F# is hard to learn! No, it’s just different than C#.

A typical conversion:

Me: “Did you take a look at F#?”
Paul*: “No, it’s just too hard to learn!”
Me: “Why?”
Paul: “I don’t understand anything because of the syntax.”

*Paul = Person assuming unyielding learning

F# isn’t hard to learn. But you probably have to learn four concepts that you may never have seen before**

**unless you have experience in other functional programming languages

Let’s see these concepts and how you can learn F# quickly.

Different concepts, but fewer of them

When I started to learn F#, I struggled to read examples because of these four concepts: significant whitespace, function arguments, pipes and computation expressions.

That’s why it’s a good idea to start with a tutorial, book or course that covers the basics first. When I learned C# – after programming C++ – I could take a lot of my understanding of C++ along, especially the syntax. So C# seemed easy to learn. When learning F#, you must take a step back and start with the syntax. That doesn’t take long, but it makes understanding the rest of F# much easier.

I would even consider F# one of the simpler languages to learn. My experience is that I learned F# much quicker than, for example, TypeScript. The reason is that while F# has some concepts that are probably new to you (the ones mentioned above), the language overall has fewer concepts than, for example, C# or TypeScript. The reason is that F# has some higher-level concepts that are reused for different scenarios, whereas C# invented a new concept for every use case. Computation Expressions can be used for asynchronous computing, query syntax, dealing with results, etc. One concept for three problems. C# has async/await, LINQ and exception handling—three different solutions for three problems.

If you don’t believe me, then compare the language documentation of F# and TypeScript 🙂

Good resources to start learning

Okay, you want to give learning F# another try. Here are some good resources:

Final thoughts and a book recommendation

And always keep in mind that we find simple what we are used to at first. Even if it isn’t. If you want to understand how our brains work when coding and learning to code, there is an excellent book for you: The Programmer’s Brain (manning.com)

So long, and thanks for the fish reading 😉

About the author

Urs Enzler

3 comments

By Urs Enzler

Recent Posts