←back to thread

Why F#?

(batsov.com)
447 points bozhidar | 1 comments | | HN request time: 0.233s | source
Show context
GiorgioG ◴[] No.43546539[source]
As a 20+ year C# developer I’ve tried several times to learn/use F#. Despite being interested in FP, my brain is having trouble figuring out how to structure my code in F#. In C# I’d either build a service (or use the mediator pattern) for the domain and a repository for data access. With F# it’s functions all the way down and it feels unnatural (as silly as that may sound).
replies(4): >>43546782 #>>43546899 #>>43551623 #>>43556011 #
1. Akronymus ◴[] No.43546899[source]
along with what jcmontx said: F# is structured bottom from top. As in you can't reference something that is later defined earlier. I find that naturally leads to getting a decent enough structure "for free" because it forces you to have your basic functionality early on and build on that later.

That also, IMO, makes untangling/splitting up parts of the codebase easier as well.