Why F#?

After working with imperative and OOP languages for nearly two decades, following infinite principles, design patterns and practices, this is what I learned:

  1. Too much time is spent on:

    1. How to achieve something, as opposed to the intent.

    2. Language nitty-gritty, ceremonial code, brackets, semi-colons, keywords galore, decorators/attributes, and the list goes on. One may argue the same for nearly all programming languages. What I can say from my experience in learning and using F# is that there is considerably less noise in code.

  2. Too many foundational ideas. Simply put, F# (or most functional programming languages) revolves around functions and data. The more time you spend in the functional world, the more you realize that there is no "big difference" between functions and data, you essentially deal with transformations.

  3. Mutability and null-hell. For most modern (and successful) OOP languages countless ideas/practices/patterns exist for dealing with mutability and null. Sadly, the foundation principles are a problem. Wrapper patterns and practices solve these problems only to a certain extent.

  4. Namesake abstraction. Personally, this is my biggest issue when dealing with OOP languages. Buried under a mess of classes, abstract classes, interfaces, and hierarchies, there is a distorted idea of abstraction. Abstraction is when the consumer isn't aware of or bothered about the structural issues of the provider, simply.

  5. Lack (or non-existent) of algebraic data types. Data modeling in the OOP world is no fun. Once again, countless revisions, ideas/practices/patterns exist, but these are not first-class citizens.

F# is Great, but...

The ecosystem isn't rich. What do I mean by ecosystem? Everything from official drivers of established software, learning material, code samples, and the community to answer your queries, to talent pool (for hiring).

I have managed to solve these issues (to an extent) one way or the other. If you like F#, hopefully, you will also figure your way out.

The Goal

My goal in writing this blog is to help programmers:

  1. Realize how to think functionally

  2. Provide fast-track learning material for F#

  3. Solve real-world problems using only two foundational ideas: functions and data

  4. Showcase how to build:

    1. Web APIs

    2. Integrate with: Database, Cache, Queue layers etc.

    3. Concurrent Applications

    4. Data Processing, Parallel Processing Applications

    5. Applications that are heavy on Business Logic (validations, transformations, pipelines etc.)

Before You Begin

Make sure to set up the development environment as described here: https://learn.microsoft.com/en-us/dotnet/fsharp/get-started/

The Source Code

The entire source can be found here: https://github.com/Ankur-Kashyap/Learning-FSharp

Good luck learning.