In this chapter, you have seen how functional programming can improve the safety of your code by not modifying the state, which can give rise to bugs, especially in multithreaded applications. By keeping methods small with meaningful names and no more than two parameters, you have seen how much cleaner your code is and easier to read. You have also seen how we can remove duplication in our code and the benefits of doing so. Code that is easy to read is easier to maintain and extend than code that is hard to read and decipher!
We will now move on and look at the topic of exception handling. In the next chapter, you will learn how to use exception handling appropriately, write your own custom C# exceptions that provide meaningful information, and write code that avoids raising NullPointerExceptions.