Wednesday, May 15, 2019

STATE OF F# / F# for next project

Hello everyone & Please accept my apologies for the long post!

Firstly, little bit of background. I am working for the startup company which I have co-funded and I am in charge of all technical decisions. Our only product is B2C app and we have pretty small tech team (2 people on the mobile app and most of the time only me on the backend, but hopefully we will hire more devs in future).

Even though I have been programming since before high school (mostly C & C#), this was my first real world project (probably not important but I was 21 then, and 25 now), and as it is not hard to imagine that I have butchered Domain - now we have anaemic Domain model and instead of Onion/Clean/Ports&Adapters architecture we have N-layered … thing. In one layer are Entities which are dependent on EF/DbContext in another Services and in top-most API & Web UI.

It is highly likely that within next 6-12 months we will be making some major changes in our domain models (because of business requirements) and we will be moving majority of data from SQLServer to DocumentDB (ie Cosmos). This is great opportunity to refactor most of (if not all) of the backend code.

This time I want to “do it right” or at least make better architecture & more importantly better domain. And I have stumbled upon F# (I’ve known that it exists but never paid much attention to it until now).

After watching couple of videos (link1 link2 link3 link4 etc.)and reading Domain Modeling Made Functional (absolutely awesome book), I’ve been feeling that F# is way to go.

And it is not just “couple of videos and articles”. We have started using ReactNative, Redux and TypeScript and functional paradigm feels way more natural and idiomatic to me. In the mobile app we also have NoSql database (Realm) and modelling “domain” via TypeScript has been pure joy and Discriminated unions have totally spoiled me. We even almost went with ReasonML instead of Typescript, but year ago it was even more “bleeding edge” than it is today. (ReasonML is just JS like syntax for OCaml, and later on I have learned that F# was heavily influenced by OCaml)

And C# feels more and more bloated for eg. what I can model in TypeScript in less than 50 lines of code, would take me 300 hundred and 3 files in C# (of course hyperbolically speaking).

Maybe it is that I have just started discovering functional programming, but I have feeling that FP is gaining pretty good momentum and I think that JS and React are one of the bigger reasons for this. And after showing my fellow co-workers a bit of F# they said, wow looks like TypeScript (and evenpipeline operator is supposed to land to JS)

So FINALLY here is my question:

Do you think F# has bright future ? When I say bright future I do not mean that it will ever be close to C#’s popularity but I am referring to lively community, regular updates, better tooling etc.

After scrolling through reddit (especially reading this post & comments and other posts like "Is Microsoft serious about F#" and "Is F# still being maintained" and simillar are not helping at all ) I am afraid that F# is loosing “popularity”, that it has not good enough tooling (or maybe people are just exaggerating about some issues), and number of people using F# is actually on the decline.

This can be problematic if we decide to go with F# and are unable to find employees in the future (not even ones who know it, but even ones who want to learn it), so we end up with the codebase that is actually good (hopefully) bout no one wants to touch.

Also I am afraid that I just want to bring F# to my project because I really like it, and not because it will give us real benefit - it is hard to stay objective all the time :/

STATE OF F# / F# for next project Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team