Course · Training · Workshop
Clean Code with C#
Write clean, maintainable C# with SOLID, refactoring, testing/TDD and design patterns - and safely improve legacy code in the .NET ecosystem.
A two or three day workshop where we explore the principles and practices of Clean Code with C#. We focus on small iterations and short feedback loops to develop efficient and maintainable software. Learn how to react fast and efficiently to changes, build production-ready APIs, and safely refactor legacy code.
Trainers
What participants say






These customers booked courses in the same topic cluster.More customers →
Content
Clean Code is a crucial aspect of software development that ensures our code remains understandable, modifiable, and extensible. In this course, we learn the principles of Clean Code and how to apply them in C#. The focus is on practical application, testing, and building production-ready code.
The workshop includes the following topics:
– Introduction to Clean Code
- Why is Clean Code important?
- How not to fall into the perfectionism trap
- Overview and expectations for the workshop
– Effective Naming
- The art of naming variables, methods, and classes
- Finding meaningful and precise names
– Clean Code Principles
- SOLID principles to improve code structure
- DRY (Don’t Repeat Yourself) vs. WET (Write Everything Twice)
- KISS (Keep It Simple, Stupid) and YAGNI (You Ain’t Gonna Need It)
- Composition over Inheritance
- Integration Operation Segregation Principle (IOSP)
– Refactoring Techniques
- Identify and name code anti-patterns (“code smells”)
- How to improve existing code without changing its functionality
- Using automated refactorings in the IDE
- Boy Scout Rule and continuous improvement
– Testing & Code Quality
- Unit testing principles
- Meaningful tests vs. mere coverage
- Test Driven Development (TDD) basics
- Using mocks and fakes effectively
– Design Patterns
- Key design patterns and when to use them
- Avoiding over-engineering
- Practical implementation of selected patterns
– Error Handling and Resilience
- Exception handling strategies
- Fail-fast principle
- Logging strategies
– Modularization in C#
- Project structure and dependency management
- Configuring dependency injection containers
- Separation of Concerns
– Working with Legacy Code
- Characterization tests for existing code
- Strangler pattern for gradual migration
- Safe refactoring techniques
– Production-ready APIs
- REST APIs with proper validation
- Error responses and documentation
- Integration tests with TestContainers
– Production Concerns
- NuGet package management
- Static code analysis
- CI/CD basics and configuration management
You will not only get to know these concepts but also apply them practically.
The actual course content may differ from the above depending on the trainer, delivery, duration and the composition of participants.
Request this course in-house
Request a public date
No suitable public date? Register without obligation — once there is enough interest we schedule a new public date and let you know first.
More about Clean Code with C#
Clean Code in C# goes beyond mere formatting – it encompasses principles, patterns, and practices for maintainable, extensible software. This course teaches SOLID, testing, refactoring, and handling legacy code with a focus on the .NET ecosystem.Further resources:
History
The term "Clean Code" was popularized by Robert C. Martin (Uncle Bob), who published the book of the same name in 2008. The principles are based on decades of software development and were shaped by pioneers like Kent Beck, Martin Fowler, and others.
For C# and .NET, these principles have been further developed by Microsoft and the community. The C# language provides direct support for Clean Code with modern features like records, pattern matching, and nullable reference types.
Today, Clean Code is a recognized standard in professional software development. Combined with testing, CI/CD, and static analysis, robust, maintainable .NET applications emerge.
