News for hackers. Stuff that matters.
Re:Things Go needs more than generics by CodesInChaos on Monday October 04, 2021 @07:51AM (#28745516)
For that I use my own extension function like `?.Map(x => ...)`, defined as `Map(this T input, Func<T, TResult> map) => map(input)`. Still a bit ugly, but much nicer than the ternary operator.

Of course that doesn't fix all the other issues with null handling in C# (inconsistency between null references and null value types, inability to nest options, ...)

There are no comments on this comment yet.