Defensive Coding in C#

Learn techniques for strengthening your application’s defenses against the perils awaiting it in the real world. You will see how to write clean code, create unit tests, build clear methods, and prepare for the unexpected.
Course info
Rating
(78)
Level
Beginner
Updated
Jan 2, 2020
Duration
2h 14m
Table of contents
Course Overview
Why Defensive Coding Matters
Strengthening Our Code’s Defenses
Validating Method Arguments
Handling Nulls
Returning Predictable Results
Managing Exceptions
Final Words
Description
Course info
Rating
(78)
Level
Beginner
Updated
Jan 2, 2020
Duration
2h 14m
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.

About the author
About the author

Deborah Kurata is a software developer, consultant, Pluralsight author, Google Developer Expert (GDE), and Microsoft Most Valuable Professional (MVP). Follow her on twitter: @deborahkurata

More from the author
Angular: Getting Started
Beginner
5h 52m
Aug 6, 2020
Angular NgRx: Getting Started
Beginner
4h 14m
Jun 30, 2020
More courses by Deborah Kurata
Section Introduction Transcripts
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.