# thangchung/clean-code-dotnet

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/thangchung-clean-code-dotnet).**

7,615 stars · 1,143 forks · C# · mit

## Links

- GitHub: https://github.com/thangchung/clean-code-dotnet
- awesome-repositories: https://awesome-repositories.com/repository/thangchung-clean-code-dotnet.md

## Topics

`aspnet` `awesome` `azure` `best-practices` `clean-architecture` `clean-code` `composition` `csharp` `dotnet` `inheritance` `principles` `solid`

## Description

This project provides a comprehensive collection of best practices, architectural patterns, and coding standards for the .NET ecosystem. It serves as a guide for developers to improve the readability, maintainability, and testability of C# applications by applying established software engineering principles.

The repository focuses on enforcing consistent code style and structure through automated configuration rules. It emphasizes the use of SOLID design principles to create modular, loosely coupled components, alongside structured exception management to ensure diagnostic information is preserved during error handling.

The guide covers a broad range of development standards, including layered architectural separation to isolate business logic from infrastructure, and the implementation of task-based asynchronous patterns to maintain application responsiveness. It also details techniques for simplifying conditional logic and encapsulating data access to ensure consistent state management across a codebase.

## Tags

### Repository Format

- [Awesome List](https://awesome-repositories.com/f/repository-format/awesome-list.md) — A community-curated directory that catalogs and links out to other open-source projects, rather than a standalone tool you run yourself.

### Education & Learning Resources

- [Dotnet Clean Code Guides](https://awesome-repositories.com/f/education-learning-resources/dotnet-clean-code-guides.md) — Serves as a comprehensive guide for developers to improve .NET application quality through established engineering principles.
- [Asynchronous Programming Guides](https://awesome-repositories.com/f/education-learning-resources/educational-resources/languages-and-programming-concepts/programming-language-mastery-guides/asynchronous-programming-guides.md) — Provides instructional resources for implementing non-blocking task-based operations in .NET applications.

### Software Engineering & Architecture

- [Dotnet Code Style Standards](https://awesome-repositories.com/f/software-engineering-architecture/dotnet-code-style-standards.md) — Provides automated configuration rules to enforce consistent code style and structure across .NET projects.
- [SOLID Principles](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/foundational-theory-and-guidance/software-architecture-principles/solid-principles.md) — Structures components using modular and loosely coupled patterns to ensure extensibility and adherence to industry-standard software principles.
- [Code Quality and Design Principles](https://awesome-repositories.com/f/software-engineering-architecture/development-methodologies/engineering-best-practices/code-quality-design-principles.md) — Provides established architectural and design guidelines to improve readability, maintainability, and testability. ([source](https://github.com/thangchung/clean-code-dotnet#readme))
- [Asynchronous Task Orchestration](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-task-orchestration.md) — Manages non-blocking input and output operations by offloading tasks to background threads.
- [Coding Standards](https://awesome-repositories.com/f/software-engineering-architecture/development-methodologies/engineering-best-practices/code-craftsmanship-standards/coding-standards.md) — Provides a comprehensive collection of coding standards and best practices to improve code readability and maintainability. ([source](https://github.com/thangchung/clean-code-dotnet/tree/master/cheatsheets))
- [Layered Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/layered-architectures.md) — Organizes software into distinct tiers to isolate business logic from infrastructure concerns.
- [Clean Architecture Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/clean-architecture-frameworks.md) — Details architectural patterns for separating business logic from infrastructure to ensure modular and testable codebases. ([source](https://github.com/thangchung/clean-code-dotnet/tree/master/cheatsheets))
- [Error Handling](https://awesome-repositories.com/f/software-engineering-architecture/error-handling.md) — Handles errors without losing stack trace information or suppressing critical diagnostic data. ([source](https://github.com/thangchung/clean-code-dotnet#readme))
- [Error Handling Utilities](https://awesome-repositories.com/f/software-engineering-architecture/error-handling-utilities.md) — Implements structured exception management by using specific catch blocks and preserving original stack traces. ([source](https://github.com/thangchung/clean-code-dotnet/blob/master/README.md))
- [Exception Logic Structures](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/exception-logic-structures.md) — Preserves diagnostic information and stack traces during error handling to ensure issues are easily identified.
- [Modular Software Design](https://awesome-repositories.com/f/software-engineering-architecture/modular-software-design.md) — Organizes software components to be modular, extensible, and loosely coupled. ([source](https://github.com/thangchung/clean-code-dotnet#readme))
- [Object-Oriented Design Principles](https://awesome-repositories.com/f/software-engineering-architecture/object-oriented-design-principles.md) — Structures software components using modular and loosely coupled patterns to ensure extensibility.
- [Asynchronous Execution Patterns](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-execution-patterns.md) — Applies task-based patterns for input and output operations to ensure proper context management. ([source](https://github.com/thangchung/clean-code-dotnet/blob/master/README.md))
- [Asynchronous Programming Patterns](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-programming-patterns.md) — Implements task-based asynchronous patterns to maintain application responsiveness and efficient thread management.
- [Naming Conventions](https://awesome-repositories.com/f/software-engineering-architecture/development-methodologies/engineering-best-practices/code-craftsmanship-standards/coding-standards/naming-conventions.md) — Applies consistent variable, parameter, and class naming conventions to improve code readability. ([source](https://github.com/thangchung/clean-code-dotnet/blob/master/README.md))
- [Exception Handling Strategies](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/exception-logic-structures/exception-handling-strategies.md) — Implements structured exception management to preserve diagnostic data and stack traces during error handling.
- [Negative Conditional Logic](https://awesome-repositories.com/f/software-engineering-architecture/negative-conditional-logic.md) — Reduces code complexity by replacing deeply nested conditional statements with early returns or guard clauses. ([source](https://github.com/thangchung/clean-code-dotnet/blob/master/README.md))
- [Guard Clauses](https://awesome-repositories.com/f/software-engineering-architecture/negative-conditional-logic/guard-clauses.md) — Improves code readability by replacing deeply nested conditional statements with early returns.
- [Codebase Standardization](https://awesome-repositories.com/f/software-engineering-architecture/project-management-governance/project-governance/standards-rule-enforcement/codebase-standardization.md) — Enforces consistent naming conventions and project structures to simplify collaboration and codebase navigation.

### Part of an Awesome List

- [Code Formatting](https://awesome-repositories.com/f/awesome-lists/devtools/code-formatting.md) — Enforces uniform indentation and whitespace rules across a project using shared configuration files. ([source](https://github.com/thangchung/clean-code-dotnet/blob/master/README.md))

### Development Tools & Productivity

- [Static Analysis Rules](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/static-analysis-engines/static-analysis-tools/static-analysis-rules.md) — Enforces consistent formatting and naming conventions through automated build-time checks.

### Programming Languages & Runtimes

- [Blocking Operation Handlers](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/execution-models/multi-threaded-execution/thread-join-operations/blocking-operation-handlers.md) — Executes non-blocking tasks for input and output operations while balancing thread usage. ([source](https://github.com/thangchung/clean-code-dotnet#readme))

### Data & Databases

- [Data Access and Querying](https://awesome-repositories.com/f/data-databases/data-access-querying.md) — Controls object state and enables validation by using properties with accessors to hide internal data representation. ([source](https://github.com/thangchung/clean-code-dotnet/blob/master/README.md))
