Clean Coding Principles in C#
Clean code is the art of writing code that humans can understand. Learn how to write C# in a style that's easy to write, read, and maintain. This course is filled with clear comparisons between "dirty" C# code to avoid, and the "clean" C# equivalent.
What you'll learn
Clean code is the art of writing code that humans can understand. In this course, Clean Coding Principles in C#, you'll elevate your professionalism and increase your C# code quality by writing with the reader in mind. This course is built upon three core clean coding practices: selecting the right tool for the job, optimizing the signal to noise ratio, and creating self-documenting logic. Throughout this course you'll see clear comparisons between "dirty" C# code to avoid and the "clean" equivalent. You'll explore patterns like arrow code, failing fast, returning early, magnet classes, mayfly variables, techniques for reducing method complexity, and much more. These practices are the foundation for a professional development career and provide developers a clear vocabulary for evaluating code quality.
Table of contents
- Intro 0m
- When to Create a Function 2m
- Why Create a Method - Reason 1: Avoid Duplication 1m
- Why Create a Method - Reason 2: Excessive Indentation 1m
- Excessive Indentation Solution 1: Extract Method 2m
- Excessive Indentation - Solution 2: Fail Fast 2m
- Excessive Indentation - Solution 3: Return Early 2m
- Why Create a Method - Reason 3: Convey Intent 2m
- Why Create a Method - Reason 4: Do One Thing 1m
- Mayfly Variables 2m
- How Many Parameters? 2m
- Signs a Method Is too Long 3m
- Handling Exceptions 4m
- Summary 1m
- Intro 0m
- Comments: A Necessity and a Crutch 2m
- Dirty Comment 1: Redundant 2m
- Dirty Comment 2: Intent 1m
- Dirty Comment 3: Apology 1m
- Dirty Comment 4: Warning 1m
- Dirty Comment 5: Zombie Code 7m
- Dirty Comment 6: Divider 0m
- Dirty Comment 7: Brace Tracker 1m
- Dirty Comment 8: Bloated Header 1m
- Dirty Comment 9: Defect Log 1m
- Clean Comments 3m
- Summary 1m
- Intro 2m
- Speaker Class Overview 3m
- Code Metrics 1m
- Automated Test Overview 1m
- Refactor Agenda Overview 2m
- Remove Unhelpful Comments 2m
- Refactor to Mayfly Variables 4m
- Positive Conditionals 2m
- Implement Guard Clauses 5m
- Rename Variables 3m
- Extract Method and Return Early 3m
- Refactor Red Flags to Method 5m
- Consolidate Guard Clauses 3m
- Extract To Approve Sessions Method 6m
- Switch to a Table Driven Method and Fail Fast 2m
- Centralize Validation 5m
- Review Outline Rule 2m
- Bug Fixes: What a Contrast! 3m
- Compare Code Analytics Results 2m
- Summary 1m