logoalt Hacker News

CharlieDigital • yesterday at 7:04 PM • 2 replies • view on HN

I also agree with this. When we were internally finalizing on C#/F#, I showed the CTO that most of what he liked about F# was already possible in C# (though requiring third party libs like OneOf or Dunet) with the benefit that C# syntax is more familiar for most folks. With 15, I think they are even closer now.


Replies

rspeele • today at 4:30 AM

One of my favorite things about F# is what some would consider a deficiency: that within a project, files must be ordered and you may only refer to a symbol defined earlier, with the sole exception of types which are explicitly declared together in a single statement (`type X = ... and Y = ...`).

This in contrast to C# where, within one .csproj, there is no "order" and all classes and methods are able to mutually reference one another.

The F# way creates an annoying housekeeping step of maintaining file order, and would be a nightmare to do with manually edited .fsproj files (I have only ever written F# with an IDE), but IMO, it is worth it. On the reading side, it makes it easier to understand how a project you've never read before is structured, since you know the order of the F# source files also must be the bottom-to-top layering of the code. On the writing side, it sometimes causes one to rethink the architecture and simplify it to minimize the number of mutual declarations.

rienbdj • today at 9:28 AM

The advantage of F# over C# is defaults and baggage. The FP story in F# is great. In C# it’s possible.