On .NET Live: How Coding Standards Supercharge .NET Quality & Performance
TL;DR
David McCarter’s core argument is that code quality is a product feature, not cleanup work — he says teams that don’t enforce standards end up with “Frankenstein’s monster” solutions, citing a real 39-project codebase with nearly 4,000 errors, almost 7,000 warnings, and 114,000 messages.
His favorite enforcement tool is an aggressively configured
.editorconfig, not vibes or optional style guides — while Visual Studio’s default template adds only 143 settings, McCarter uses a 3,146-line file with 1,228 settings and often upgrades recurring warnings to errors because they represent the same mistakes he keeps seeing in reviews.Disposable-object mistakes are, in his view, the #1 hidden reliability problem in .NET codebases — one production system had 600 missed
Disposecalls and 90 incorrectly implementedIDisposabletypes, which he says contributed to the mysterious backend processes managers kept having to restart.He makes a strong case for XML docs as operational tooling, not just documentation theater — his examples show IntelliSense surfacing return values, exceptions, and even usage examples, plus extras like Mermaid diagrams generated with Copilot and embedded via CodeRush.
Cyclomatic complexity is the bridge between messy code and missing tests — McCarter frames it as the minimum number of unit tests required just to cover code paths, so a project with 77,781 complexity implies roughly 77,000 missing tests, and Azure Core’s 115,000 complexity suggests an even bigger testing gap.
He’s skeptical of AI for coding standards but positive on AI for test generation and profiling — he says Copilot in Visual Studio still “mangles” code too often, but GitHub Agent gets him about 90% of the way on unit tests and can work in the cloud while he keeps coding.
Summary
A 20-year book, and the same seven mistakes again
David McCarter opens by framing the talk around his new 498-page edition of Rock Your Code, which he notes has now been around for roughly 20 years. His frustration is the point: after decades of .NET, he still sees the same avoidable quality mistakes in enterprise code, open source, and even Microsoft projects.
Quality has to be enforced, not merely declared
He starts with the blunt question: is quality built into your code, or treated as an afterthought? To make it real, he points to one recent solution with 39 projects, nearly 10,000 lines of clone code, 523 unit tests, 77,781 cyclomatic complexity, almost 4,000 errors, nearly 7,000 warnings, and 114,000 messages — his evidence that teams without standards just “check it in and it works.”
Open source isn’t getting a free pass either
McCarter says when he runs out of client horror stories, he audits major open-source projects. The AWS SDK clocked in at 442 projects and almost 55,000 code violations, while Azure Core showed over 200,000 violations, 532 clone blocks, 2,532 unit tests, and nearly 115,000 cyclomatic complexity — a moment that got a mix of laughs and pain from the hosts.
The humble .editorconfig as a quality weapon
His practical recommendation is to turn on analyzers everywhere and stop relying on default settings. Visual Studio’s generated .editorconfig has only 143 settings, but his custom version has 1,228 settings across 3,146 lines, covering things like async rules, globalization, and code quality; he uses it to drive the massive violation counts he reports and argues that warnings-as-errors should stay painful until teams fix them.
Why he obsesses over XML docs and IntelliSense
One of the quieter but more compelling sections is his case for XML documentation on methods, properties, and exceptions. He shows how rich docs make IntelliSense actually useful, including thrown exceptions and usage examples, and then goes full David by showing a Mermaid diagram embedded above a method using CodeRush after having Copilot generate the diagram.
The backend restarts were probably Dispose bugs
His most urgent section is on virtual memory issues caused by missed disposal patterns. He says nearly every company he joins admits they have backend processes that need mysterious restarts, and he often traces that back to disposable objects not being wrapped in using statements or classes implementing IDisposable incorrectly; in one codebase, fixing those mistakes took six months.
Encapsulation and architecture still matter more than clever code
McCarter then shifts into old-school-but-hard-to-argue-with engineering principles: validate every input, hide data behind properties and methods, and stop exposing public fields. He pairs that with a defense of layered architecture — especially keeping data models and database concerns separated — saying most projects he inherits feel like Frankenstein creations because people code all day instead of planning, designing, and documenting.
Globalization, testing, and AI’s current sweet spot
He races through globalization as a requirement most teams postpone until it becomes expensive and boring, then lands on unit testing as the final quality gate. His memorable framing is that cyclomatic complexity equals the minimum number of tests needed for path coverage, and while nobody enjoys writing tests, he says GitHub Agent is now his preferred workaround: ask it to review a file, add missing tests, watch its reasoning in the cloud, and then verify the logic before merging.
Was This Useful?
Share
Keep Reading
Make Alcreon Yours
Tune your feedFive quick questions, and the feed ranks what matters to you first.Or just get notified
The weekly Echo. Signal worth keeping in your inbox.
Every new piece, announced on X.
Read Next
See all
Playbook
The Retirement Email Isn't a Warning
Model retirements now arrive every few weeks; the config-eval-rehearsal loop turns each deprecation email from a fire drill into an afternoon swap.

Playbook
The Cheapest Model That Passes
OpenRouter lists 400 models behind one API. The fix for choosing isn't a better leaderboard, it's a four-step protocol that ends in a real eval.

Playbook
Cheap Models, Hard Tasks
Most agent workflows route every step to the frontier model by default. The bill scales with how chatty the agent gets, even when most steps don't need that brain.