Functional Programming – What to Learn and Who Uses It

angularfunctional programminghaskellnet

I'm a .Net and Angular developer who's been working with OO languages throughout my education and work history. Lately I've been thinking about spending some time with one of the functional programming languages, namely Haskell, to try and get a feel for what functional programming is all about.

My main reservations are on whether Haskell is a good language to start with and whether it is actually used anywhere in the industry. I guess the industry use question is more broad to target all functional languages. I have never personally met anyone who worked with functional programming language in their day today job. I'm basically trying to justify learning a functional programming language instead of another OO library or framework, relevant to my field.

Best Answer

Since you write that you're a .NET developer and you don't even mention F#, odds are that you're a C# developer. In that case, I'd strongly suggest that you learn F# first. It's another .NET language, and it's a great stepping stone for anyone coming from C#.

In itself, it's a great FP language, but it also offers full interoperability with the existing .NET ecosystem. Besides its FP features, it also offers a full set of OOP features. This enables you to learn gradually.

  1. Learn the F# syntax, but keep on writing object-oriented code. You can do this in a week or two.
  2. Start learning functional concepts. For instance, once you understand maps and folds, replace your for loops with those.
  3. Learn more abstract functional ways of thinking. Repeat from here.

You can take each of these steps in small increments, all the time staying productive.

Once you have a good grasp of the functional parts of F#, Haskell can be a good next step. I've met many people who tried to learn Haskell 'from scratch'. Most people report that they give up because the learning curve is too steep.

I came to Haskell via some years of F# and found it a natural next step.

There's lots of free learning resources for F#, the most famous of which is probably F# for fun and profit. If you come from C#, another great introduction to F# is Real-World Functional Programming. It juxtaposes examples in C# and F# so that you can compare.

As far as I can tell, there aren't a lot of jobs where you get to program exclusively in F# or Haskell, but learning either will likely still make you a better programmer, so I'd highly recommend it.

I've written F# professionally, but never Haskell. I've written a lot of Haskell semi-professionally; I'm self-employed and invest significant time in doing so, but no-one has ever paid me to program in it. Still, I consider it highly worthwhile.