3 ms·
> It is still not clear to me what the advantages of using a functional language like F# vs writing C# code that avoids side effects and mutating objects in fun
by Zababa 5y ago
> It is still not clear to me what the advantages of using a functional language like F# vs writing C# code that avoids side effects and mutating objects in functions.
Personally, the thing I like about functional languages is that good practices are often the default way of doing things. For example, in OCaml, you can create mutable values with "ref", or a record with mutable fields with "mutable". You also have access to mutable arrays. But the default is immutable values, records and lists. Same thing with the compiler/type system: Hindley-Milner is a great default. OCaml also has a whole object-oriented system that works well, but the default is plain functions and data structures.
The difference between C# and F# or OCaml isn't as big as before these days. But having good defaults is, I think, very important.