Defensive Coding in C#

This course will show you how to write clean, maintainable, and testable code, and how to keep that code great using defensive coding techniques.
Course info
Rating
(1601)
Level
Intermediate
Updated
May 9, 2014
Duration
4h 32m
Table of contents
Description
Course info
Rating
(1601)
Level
Intermediate
Updated
May 9, 2014
Duration
4h 32m
Description

You will learn how to write clean, maintainable, and testable code when faced with constantly changing requirements, legacy issues, intensive time pressures, and a rapidly evolving environment. You will also learn how to keep that code great after maintenance activities, multiple developers, and the ravages of time.

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 41m
Nov 8, 2018
Angular Reactive Forms
Intermediate
3h 52m
Nov 6, 2018
Angular NgRx: Getting Started
Beginner
4h 4m
Jun 25, 2018
More courses by Deborah Kurata
Section Introduction Transcripts
Section Introduction Transcripts

Introduction
Want to write great maintainable code, even when faced with constantly changing requirements, Legacy issues, intensive time pressures, and a rapidly evolving environment, and want to keep that code great after maintenance activities, multiple developers, and the ravages of time? Welcome to Defensive Coding in C#. My name Deborah Kurata, and this course will show you how to write great maintainable code, and keep that code great using defensive coding techniques.

Defending Your Methods - Part 2
Refactoring to cleaner methods protects those methods from now into the future by improving comprehension and intent, but we have not yet considered predictability. What if invalid data is passed into a method? Welcome back to Defensive Coding in C#. My name is Deborah Kurata, and this module continues applying defensive coding techniques to methods by beefing up their cleanliness, quality, and predictability, with a focus on predictability. Earlier in this course we outlined the goals of defensive coding. Improving comprehension and reducing bugs through Clean Code. Improving application quality with Testable Code and Unit Tests. And improving code predictability by handling the expected and the unexpected. In the prior module we looked at some techniques for refactoring a long and smelly method into cleaner, testable methods. It is much easier to implement additional defenses when you can start with clean code. This module focuses on validation of incoming parameters to defend your methods from invalid inputs.

Defending Your Methods Part 3: Returning Predictable Results
Welcome back to Defensive Coding in C#. My name is Deborah Kurata, and this module continues applying defensive coding techniques to methods, with a focus on Returning Predictable Results. Earlier in this course we outlined the goals of defensive coding: Improving comprehension, simplifying maintenance, and reducing bugs through Clean Code; improving application quality with Testable Code and Unit Tests; and improving code predictability by handling the expected and the unexpected. We have already seen how to build clean and testable methods, we've seen how to use automated code testing techniques to build and execute unit tests, and how to improve code predictability by validating method parameters with guard clauses. This module looks further at method predictability with a focus on returning predictable results from our methods. This module looks at several types of method results; returning a Value, returning Exceptions, returning Multiple Values, and returning Null.

Final Words
Welcome back to Defensive Coding in C#. My name is Deborah Kurata, and the final words in this course include tips for using defensive coding techniques with Legacy code. There is also a summary of the key points in this course and a list of additional Pluralsight courses that expand on the topics covered in this course.