4 ms·
>Do we know any reason for C# not to adopt this as well? Because delegates are a much easier way of dealing with things? Especially with lambda functions. Unle
by pikzen 9y ago
>Do we know any reason for C# not to adopt this as well?
Because delegates are a much easier way of dealing with things? Especially with lambda functions.
Unless you're talking about the java pattern of passing an entire anonymous class for, let's say, a formatter or something. The reason for C# not to adopt that seems to be that:
- It's so terribly awful, who in his right mind is happy to implement yet another anonymous class?
- API design is different and .NET manages to avoid the need of those quite gracefully.
- douche 9y agoThere is some crap like that still kicking around. Why you need to create a Comparator class to provide a single function for sorting or filtering out duplicate items is silly, when a Func <T, bool> lambda would work? Because it's the old way of doing things, back in the 1/2 era, when delegates didn't have all the syntax sugar to make them painless.