|
|
|
|
|
by gambler
2817 days ago
|
|
>.NET is still very popular but it definitely did not fulfill the more ambitious dreams that Bill Gates had for it. There is still time. It just recently got open-sourced, got a compiler written in itself and got a run-time unbundled form all the legacy crap. Those things held C#/.NET back. I feel this is a good time to adopt it for people who want to have reasonable performance, static typing and a mix of OOP/functional paradigms. My two notes on C#: 1. It is possible to write reasonably "functional" applications in .NET. The only problem I had with that is lack of built-in copy-on-write data types and prevalent nullity. 2. LINQPad is the best damn scripting environment I ever worked with. |
|
I've tried to minmise that pain over the past few years with my 'functional language extensions' for C# [1].
It's a library with most of the common monadic types (as structs so there's no null issues); Immutable collection types that don't have an unweildy naming scheme like like the System.Immutable.Collections library - which are all structs, so no nulls; A type called 'Record<T>' which when you derive a type from it gives your type value-semantics (equality, ordering, GetHashCode, ToString, serialisation/deserialisation) by default; and tons more.
You still have to do stuff like build your own With method for immutable types. I have written of how these can be achieved _realtively_ easily [2]
C# has made great strides over the past 10 years to make it easier for those of us that want to work functionally to do it. It still has some way to go (discriminated unions, higher-kinds, record types, etc.) but it's already possible to write code functionally - you just need to do some boilerplate every now and then.
[1] https://github.com/louthy/language-ext
[2] https://stackoverflow.com/questions/38575646/general-purpose...