Skip to content

Thoughts from the trenches on how to use C# and its features to create great code that is easy to maintain, deploy and support

License

Notifications You must be signed in to change notification settings

DonFrazier/HowToDoCSharpRight

Repository files navigation

HowToDoCSharpRight

Thoughts from the trenches on how to use C# and its features to create great code that is easy to maintain, deploy and support. Done right it helps you sleep soundly even when you are on call.

Coding Style and .editorconfig, Whitespace wars, line length

Naming Things, Utility, Utils, Shared, Common, Helper, Don't Repeat Yourself

Designing to Interfaces

Hiding Things the Environment and Platform behind Interfaces, Environment, Files System, await Sleep, Delay

Primitive Obsession and why losing it is a good idea, no dependencies, Domain Model, Domain Knowledge

Observability, Logging, Metrics

Polly

Feature Switches

Linq, IEnumerable and Deferred Execution

Dependency Injection

Testing, Moq, NSubstitute, TestImplementations, XUnit, FluentAssertions

asp.net startup files and Factories, controllers take the request directly to a service handler and return its response

Configuration, Secrets, Timespans, Durations, Dates, Times, DateTimeOffset, ISystemClock

Certificates

Nuget

Do not reinvent your own Language Features

Do not reinvent storage formats JSON XML

Do not reinvent encryption

async and await

Getting HttpClient Right

Language features to use: See Glorp.Render.Memory.csproj implicit usings, global aliases, using statement vs. block, static using, nullable, WarnAsError, Usings in project file,

CRUD, POST, GET, PUT, PATCH, DELETE

User Input

About

Thoughts from the trenches on how to use C# and its features to create great code that is easy to maintain, deploy and support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published