4

Honest Functions, Null, and Option

In this chapter, we discuss the art and science of honest functions, the intricacies of null, and the C# tools tailored to address them. But before we dive deep, let’s lay out the roadmap:

  • Understanding honest functions
  • The problems with hidden nulls
  • Embracing honesty with nullable reference types
  • Beyond null: Option
  • Real-world scenarios

As you navigate through this chapter, be on the lookout for practical advice and evidence-backed guidelines. Come with a curious mind, and by the end, you’ll possess the know-how to write more transparent and resilient C# code.

Just as we did in our previous chapters, let’s assess where you stand. Here, there are three tasks for you. If you’re unsure about tackling them, ...

Get Functional Programming with C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.