Defensive Coding in C#
Course info



Course info



Description
Great applications perform required operations as expected, help users enter correct data, handle system and application exceptions, and make it easy for future developers to modify and maintain the code. Defensive coding focuses on improving code comprehension through clean code, improving code quality with unit tests, and improving code predictability by building clear methods and preparing for the unexpected. In this course, Defensive Coding in C#, you will gain the ability to strengthen your application’s defenses against the perils awaiting it in the real world. First, you will learn how to improve your code comprehension by following techniques such as the Single Responsibility principle. Next, you will discover how to improve your code quality through unit tests. Finally, you will explore how to improve your code predictability by validating method arguments, handling nulls appropriately, returning predictable results, and managing exceptions. When you are finished with this course, you will have the skills and knowledge needed to strengthen your code’s defenses.
Section Introduction Transcripts
Course Overview
Hi everyone. My name is Deborah Kurata. Welcome to my course, Defensive Coding in C#. Great applications help users enter correct data, perform required operations as expected, handle system and application exceptions, and make it easy for future developers to modify and maintain the code. Defensive coding techniques are a set of programming guidelines and habits that will immeasurably improve your code's comprehension, quality, and predictability. Some of the major topics that we will cover include improving your code's comprehension by writing clean code and following techniques such as the single responsibility principle, improving your code's quality through unit tests, and improving your code's predictability by validating method arguments with Guard clauses, handling nulls appropriately, returning predictable results, and managing exceptions. Along the way, we'll explore some of the newer features of C#, including the reference type nullability features in C# 8, the enhanced tuple syntax from C# 7, and the null conditional operator and exception filter syntax from C# 6. By the end of this course, you will learn the techniques you need to protect your code, both now and in the future from the perils of the real world. I hope you'll join me on this journey to learn defensive coding techniques with the Defensive Coding in C# course, at Pluralsight.