News for hackers. Stuff that matters.
Re:Span<T> in C# by jayd16 on Sunday November 19, 2017 @02:02PM (#15735299)
Delegates are nice in the common case but I do miss anonymous classes.

Anonymous classes have better oo organization than passing in two or more delegates. Sometimes variable capture doesn't cut it or isn't as clear.

..And the biggest thing. I can pass it in to a method that already takes a class and not a delegate.

Re:Span<T> in C# by noblethrasher on Sunday November 19, 2017 @04:48PM (#15736132)
> And the biggest thing. I can pass it in to a method that already takes a class and not a delegate.

One solution is the build a small inventory of "ad-hoc" classes that just wrap a delegate (usually a closure), as described here: https://stackoverflow.com/questions/20703002/does-object-exp...