You should always check the data being returned.

Null objects allows you to be more expressive. I see my example of returning an Invalid author when none is found is not really a good example. In production code we’d normally return an “Author.Unknown” type instead.

And obviously you should have tests that’d catch these logical errors.

MSc. | Tech writer with +1M views. Sharing my opinion and what I learn. .NET backend engineer, ex big4 SC. New YouTube Channel