Discussion on:
View:
Show:
I just wish it weren't so verbose, like everything else in .NET.
... where you just say, "please give me eval()".
There is something about the Microsoft mindset that insists that everything have more features than you know what to do with. It's the "enterprise class" mentality, it's born out of the need to sell upgrades or justify support contracts.
J.Ja
J.Ja
Looking at the syntax, the problem is that they've implemented functional programming using an object-oriented framework -- so all the verbiness has to get nounified.
But yes, there's also the Enterprise Mindset, where even namespaces have to be gratuitously nested to three or four levels for the sake of "robustness".
But yes, there's also the Enterprise Mindset, where even namespaces have to be gratuitously nested to three or four levels for the sake of "robustness".
You can write Justin's CreateAdderFunction like this:
public static Func CreateAdderFunction(int amountToAdd)
{
Expression<Func<int, int>> expression =
numberToAdd => amountToAdd + numberToAdd;
return expression.Compile();
}
public static Func CreateAdderFunction(int amountToAdd)
{
Expression<Func<int, int>> expression =
numberToAdd => amountToAdd + numberToAdd;
return expression.Compile();
}
... because I am fairly certain that less than 50% of my audience has used it. When I give my presentation, that's the number I get when I poll the audience, about 30% - 50% depending on the crowd. 
J.Ja
J.Ja
... but then, I love Lisp. In truly functional languages, though, you wouldn't even need to state that what you were creating was a "function object" -- that fact is built into the semantics of the language. So even the improved version seems too verbose to me.
- Keyboard Shortcuts:
- Prev
- Next
- Toggle









































