Summary
In this chapter, we addressed a series of advanced language features. We started with delegates and events that implement callbacks in a strongly-typed manner. We continued anonymous types and with tuples, which are lightweight types that can hold any value and help us to avoid defining new explicit types. We then looked at pattern matching, which is the process of checking whether a value has a particular shape as well as extracting information about it. We continued with regular expressions, which are patterns with a well-defined grammar that can be matched against a text. Lastly, we learned about extension methods that make it possible to add functionality to types without changing their implementation, such as when we don't own the source code.
In the next chapter, we will discuss garbage collection and resource management.