Hacker News new | ask | show | jobs
by simontcousins 3258 days ago
My team switched an entire application from C# (~350k loc) to F# (~30k loc). Smaller team, smaller code base, fewer bugs, complete implementation of requirements, clearer code. The whole of the F# code base was less than the number of blank lines in the C# code base and a lot more fun to read and write.

https://github.com/Microsoft/visualfsharp/issues/2766#issuec...

1 comments

Wow. I have been using C# for a long time and has dabbled in F# a little bit. And I know F# can help you reduce some boilerplate that C# requires but I have never seen reducing code base by 90 percent like in your case. Can you give us little bit more details? Eg 350k doesn't include blank lines, right? What did the application do? Is it a Windows service or a Web App or a command line program?
The app evaluated the expected income from Ancillary Service contracts in the UK energy market and subequently reconciled against actual income:

https://en.wikipedia.org/wiki/Ancillary_services_(electric_p...

It comprised a windows server, a web app and a calculation engine.

As well as remorselessly removing boilerplate code using FP techniques the F# solution also allowed us to explore our way, via the REPL, to solving the problems we were faced with and come up with better ways of doing things. The clarity, concision and low ceremony of F# code allowed us to rapidly evaluate and change approaches if necessary.

I find getting into the flow of development much easier in a language that supports this exploratory approach to programming - leads to less rigid thinking.