Master the Art of Writing Clean Code in C#
4.4 (250 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,067 students enrolled

Master the Art of Writing Clean Code in C#

Learn how to write clean and maintainable code in C# as bequeathed by Uncle Bob. Learn how to perform refactoring in C#.
4.4 (250 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,067 students enrolled
Created by Engineer Spock
Last updated 7/2020
English
English [Auto]
Current price: $48.99 Original price: $69.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 7 hours on-demand video
  • 3 articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Give best names for functions, variables and other API members
  • Understand and rely on programming metaprinciples such as DRY, YAGNI, KISS and others
  • Write clean functions
  • Detect common architectural smells and refactor the problems
  • Apply principles of functional programming
  • Apply Dependency Injection and avoid common DI-related smells
  • Write clean unit tests
  • Practice Test-Driven Development
Course content
Expand all 88 lectures 07:09:38
+ Before Taking the Course
4 lectures 02:46
How to Ask Questions
00:22
Download Source Code
00:04
Join .NET Community of Students
00:02
+ Programming Metaprinciples
9 lectures 01:03:00
KISS - Keep it Simple, Stupid
07:37
YAGNI - You Ain't Gonna Need It
11:37
Separation of Concerns (SoC)
04:28
Command-Query Separation Principle (CQS)
02:14
Principle of Least Astonishment
03:03
Encapsulation and Information Hiding
19:13
Conclusion
02:41
+ Naming API Members
5 lectures 33:52
Outline
01:28
General Principles of Naming
12:46
About Naming Once Again
11:01
Naming Conventions in .NET
07:26
Conclusion
01:11
+ Writing Clean Functions
18 lectures 53:38
Outline
01:26
Variable Declaration on the Top
01:04
Magic Numbers
01:31
"Stringly" Typed Smell
01:08
Property VS Method
06:41
Implementing Parameters
03:20
Too Many Parameters
02:28
Too Long Methods
06:20
Creational Patterns VS Constructors
03:11
"Extract Method" Refactoring
02:40
Simplifying Complex Logic
02:47
Sequence of Arguments
04:17
Guard Clauses and Early Returns
02:27
Poor Conditional Clauses
03:46
Output Parameters
03:00
Comments
03:13
Prefer Positive if-Statements
01:02
Conclusion
03:17
+ Common Architectural Design Smells
8 lectures 30:05
Outline
01:10
Primitives Obsession
02:50
Violation of Law of Demeter
06:49
Temporal Coupling
01:36
Refactoring to "Template Method" Design Pattern
05:49
Refactoring to "Strategy" Design Pattern
03:13
Refactoring to "State" Design Pattern
07:01
Conclusion
01:37
+ Functional Programming: Extendibility and Immutability
17 lectures 01:32:47
Outline
02:16
Functions, Functions, and Functions Again
02:42
Why Functional Programming?
02:30
Immutability. Intro
06:59
Immutability of Structures
04:17
Temporal Coupling and Immutability
05:26
Pipelining
01:39
Extending IDisposable
09:08
General Extensions
10:23
Extending StringBuilder
10:36
Abusing Extension Methods
07:49
Errors and Functional Programming
02:58
Errors Handling: Pipelining by Method Chaining
05:35
Conclusion
02:52
+ DI-Related Anti-Patterns & Refactorings
10 lectures 43:20
Outline
01:57
Control Freak
07:22
Ambient Context
03:39
Facade Service
02:58
Property Injection Means Bastard Injection?
03:34
Cyclic Dependencies
11:34
Conclusion
02:19
+ Clean Unit Tests
8 lectures 43:41
Outline
Processing..
Singletons and Static Classes
07:02
Too Many Interfaces
05:32
Removing Interfaces
14:02
Testing Trivial Code
02:59
Test Single Concern
03:06
More Unit Testing Best Practices
09:52
Conclusion
01:08
+ Clean Code and TDD
9 lectures 01:06:29
Outline
00:48
What is TDD?
05:00
Red / Green / Refactor
04:16
Three Laws of TDD
01:42
Reading Roman Numerals
12:07
Continuous Testing
03:57
Tic-Tac-Toe (Crosses and Noughts)
36:17
Conclusion
01:04
BONUS Lecture
01:18
Requirements
  • You should already be familiar with the basics of C#
Description

Learn how to design and implement types in C# so that the other developers won't hate you when using one of the types developed by you. It means you are going to learn how to write code of the high quality: readable, understandable and reliable.

Improve your knowledge in object-oriented programming in the context of clean coding and building types of high quality.

  • Learn how to give the best names for API members 
  • Learn all the tricks related to writing clean functions
  • Avoid common architectural smells. Get rid of unpleasant smells
  • Apply principles of functional programming: achieve immutability, remove side effects, extend types
  • Avoid smells related to dependency injection
  • Write cleaner unit tests
  • Practice Test-Driven Development

Foundations of building object-oriented infrastructures

Despite the fact that C# is a very rich on features language, it's very common to see poorly designed and implemented types in a real world. In fact, C# is one of the richest on features language among object-oriented languages in the world nowadays. But with great power comes great responsibility. It's challenging  to use all those features in a right way.

You probably have already heard the following well-known statement: most code sucks. Well, this course is all about how to produce code which doesn't suck.

Owning skills of producing a well-designed and well-implemented types is the prerequisite for the other developers to treat you as a real professional.

Content and Overview

This course is aimed at all the C# developers, from beginners to seniors. Topics which are covered in the course are relevant for all kinds of C# developers since all developers design and implement APIs. The topics complexity is very different. There are plenty of very simple topics, and at the same time, there are topics which require from you a solid C# background. There are plenty of code examples throughout this course, so you will learn both theoretical and practical material.

The course covers the following topics:

  • Meta Principles: DRY, KISS, YAGNI, SoC, CQS, PoLA, Encapsulation
  • How to give better names for API members and what naming conventions exist in the .NET platform and suited for C#
  • Common problems encountered by C# developers in the process of designing and implementing APIs: classes vs structures, creational patterns vs constructors,  poor naming, excessively long methods, output parameters and so on.
  • Common Architectural Design Smells such as Primitive Obsession, Hidden Dependencies, Violation of Law of Demeter and other.
  • Functional Programming: immutability, temporal coupling, pipelining, extending IDisposable, Builder Design Pattern, abusing extension methods, dealing with errors
  • DI-related anti-patterns: control freak, hidden dependencies, temporal coupling, ambient context, facade service, bastard injection, cyclic dependencies
  • Clean Unit Tests: singletons and static classes, excessive number of interfaces, testing trivial code, testing of a single concern, different best practices
  • Practicing TDD: definition, 3 laws, parsing roman numerals, continuous testing, implementing Tic-Tac-Toe

The list is far from being complete. The course covers a great number of topics. Enroll and start Mastering the Art of Writing Clean Code in C#!

------------------------------------------------------------

Keywords related to the course:

  • C# Clean Code
  • C# Best Practices
  • API in C#
  • Building API in C#
  • Clean Code in C# tutorial
  • Refactoring
Who this course is for:
  • Beginner and intermediate level C# developers