3 ms·
Functions in C# aren't really first class. A static method for example isn't a Func< > or an Action< > and neither are normal methods, both of which are prevale
by bad_user 8y ago
Functions in C# aren't really first class. A static method for example isn't a Func< > or an Action< > and neither are normal methods, both of which are prevalent. To say that C# has first class functions is a misnomer.
And on anonymous methods (delegates), Func< > and Action< >, that there's even a difference between the 3 shows C#'s age and some of its quirks.
> now tuples and pattern matching in C# 7
Note the pattern matching in C# is a far cry from what you get normally in FP languages. First of all C# does not have ADTs, which means it cannot do exhaustiveness checking, making pattern matching only a superficial syntactic sugar.
Tuples are nice though.
> academic functional programming world and presented them in a nice 'friendly' form
This is sort of a marketing myth. C# is not an FP language and I rarely see actual FP built in C# (same goes for Java).
In my opinion you should try out the languages in the "academic functional programming world". Because you'll then notice that C#'s way of doing things is not "friendly", unless by that you mean half baked and annoying ;-)
- zengid 8y agoI totally agree that FP in C# isn't super nice (its clear that it's bolted on) but to match the style of my co-workers, I can't do much more than sneak in a few little things here or there. The bulk of the code is clearly OOP, and I've accepted that, but at least I can have a little fun with some LINQ and a few extra vars that I don't mutate. :)
- bad_user 8y agoTrue :-)
- Bizarro 8y agoFP is a style of programming and not a language. You can write imperative code in Haskell.