Photo by Tracy Adams on Unsplash

Why developers should learn F#

Doug Ross
Skills Matter
Published in
5 min readFeb 4, 2019

--

In the lead up to this year’s F# eXchange in London, we asked a few of our experts to dive into their love affair with the language.

Dennis Grimminck

Dennis has a PhD in physical chemistry, mostly molecular physics related, from the Radboud University Nijmegen. He has spent 4 years developing physics models at ASML Research and is currently a software developer at Petersburg Consultants

Why should people learn F#?

F# sharp’s concise nature leads, somehow in a natural flow, to condensed and maintainable code. The code I wrote that does not look that way, tells me time and time again that I did not fully grasp the essence of the coding problem. The code documents itself by means of: the algebraic type system, pattern matching, active patterns, and of course the functional-first paradigm (awareness of side effects) that optimally leverages the compiler assistance!

No red squigglies means properly working code 9 out of 10 times. In addition to what the language design offers, obviously the (interope with) .NET ecosystem and great editor tooling (in particular Ionide) make for a pleasant and productive experience.

What do you like about F#?

  1. I definitely love the community. It is very diverse in terms of people’s backgrounds and it is also very active in responding to questions and suggestions. Alfonso Garcia-Caro’s keynote talk at FSharpX’18 was a beautiful tribute to and description of the community! In addition to that, I like the fact that F# goes hand-in-hand with Microsoft’s opening up to the world of open source software development.
  2. Design, as mentioned in my first answer. But also features such as type providers. I found it a very good experience to have the type providers enable me to code with data instead of, let us say, against.

What is F# good for?

  1. Domain modelling: getting to a natural description of your domain with the type system that is enabling you to talk directly about the code with domain experts. Also, the make illegal states irrepresentable is very powerful here.
  2. Working with data with the type providers. It is just fast and precise.

What’s your development setup?

VScode, Ionide plugins, paket, F# 4.5, FsLab, DotSpatial

Roman Provazník

Roman Provazník is a .NET developer, software architect and the founder of the Czech F#/functional .NET community called FSharping. He has been developing applications for more than 18 years using languages like Pascal, Delphi, PHP, C# and F#.

Why should people learn F#?

If you are a .NET developer, going for F# is a logical step. You can take all your precious knowledge of .NET, BCL, and the Microsoft ecosystem and take it to another level. The possibility to combine functional and OOP paradigms, immutability and built-in algebraic data types — all backed with solid and performant .NET platform — gives you an outstanding productivity boost.

As a C# developer, sometimes you need to step away from the ideal solution to keep it simple. In F# you don’t have to. You can start with what you already know from C# and take off step-by-step the unnecessary complexity. At the end, you have the same solution you would have in C#, but shorter and probably much safer.

By the way, I haven’t seen NullReferenceException for months… does it still exist?

What do you like about F#?

Where should I start? I love functions as first-class citizen, discriminated unions, ML syntax, immutability… There are so many things to love about F#, but if I would have to select one, it would be the strictness. F# doesn’t let you go down a “dirty path” — sometimes with warnings, sometimes you even do not compile your code if you write it in an unsafe manner. The way F# compiler convinces you to choose a better approach is addictive. If you find yourself fighting with the compiler, you know your thinking is probably (about 99.999%) wrong.

After all, who am I to argue with something designed by Don Syme?

What is F# good for?

In our team, having F# as THE language, we have already tried to solve many problems. Data gathering service running in Docker? No problem! REST API using Giraffe and ASP.NET? Sure! Event sourcing system running in Azure? Here, hold my F#. Custom DSL solving constraint satisfaction problem for door manufacture? Why not! And what about the wild waters of frontend web development? With great libraries like Fable & Elmish, we can now do the full-stack delivery and share the code across fronted/backend borders.

The list of problems solvable with F# is longer every year and now I cannot think about something from enterprise software development that could not be resolved by F#. It is .NET after all, right?

What’s your development setup?

I am still the Windows guy, so Windows 10. I use VS 2018 and VS Code with Ionide. And drink a tonne of coffee (no milk, no sugar).

Music: match mood with: | Great — play Public Service Broadcasting | a so-so mood — play Prago Union | Bad — play The Cure.

Tomasz Heimowski

Tomasz is a passionate developer whose main areas of interest are F# and Functional Programming in general.

Why should people learn F#?

F# is a fantastic language that allows you to do a lot with little coding required— efficiency for the win! Functional programming gets more and more attention nowadays, so it’s worth discovering languages that were created with this paradigm in mind.

What do you like about F#?

I love F# simplicity, type safety, and its syntax. It has a really great balance between being advanced and practical.

What is F# good for?

To be honest, I have not yet personally encountered any use case where I wouldn’t consider using F#.

What’s your development setup?

I’m currently using a MacBook Pro and Visual Studio Code with awesome Ionide plugin for F# support. I enjoy coffee during morning coding sessions.

I like acoustic/electronic music that doesn’t distract my attention. I find some BBC Radio 1 Essential Mixes to be good background music.

Originally published at skillsmatter.com. 👍 For news and articles from Skills Matter, subscribe to our newsletter here

--

--