3 ms·
This is really good stuff, but most importantly remember that every time you go out to .NET and could get a null, sort it all out as close to the call as possib
by DanielBMarkham 11y ago
This is really good stuff, but most importantly remember that every time you go out to .NET and could get a null, sort it all out as close to the call as possible. Don't be cute and wrap it in an option, or try some 3-levels-out try-catch block from hell. Acknowledge what could happen and deal with it.
I've found that every little bit my code gets away from that call without handling the null, things get more and more complicated.
- wtetzner 11y ago> Don't be cute and wrap it in an option Unless of course that's the right semantics. Often methods use nullable references as a poor man's Option.