Simple play icon Course
Skills Expanded

Working with Nulls in C#

by Jason Roberts

Learn how to create, check for, access, and eliminate nulls in your C# applications.

What you'll learn

Unexpected null values and NullReferenceExceptions can be a constant source of bugs resulting in wasted time and out of hours support callouts. In this course, Working with Nulls in C#, you're going to learn about the different ways that null values pop up in C# code and how to deal with them. First, you're going to learn the fundamentals of why you get null values and the difference between value and reference types. Next you'll learn how you can use the various C# operators to check for and manipulate nulls. Finally, you'll learn how to think about nulls at a higher abstraction level in your object-oriented code. By the end of this course, you'll understand the different types of objects in C#, how to correctly create nullable value types, how to use C# operators to work with nulls with fewer lines of code, and how to implement the Null Object pattern to remove the need to write repetitive null checking code.

About the author

With over 15 years of experience in both frontend and backend software development, Jason Roberts is a freelance developer, trainer, and author. He holds a Bachelor of Science degree in computing, is the author of several books, and writes at his blog Jason is an open source contributor and in addition to enterprise software development, he has designed and developed Windows Store and Windows Phone apps.

Ready to upskill? Get started