Menu

Stop arguing about C# style in code review: let the build say no
📰

Stop arguing about C# style in code review: let the build say no

DEV Community: dotnet·RzR·3 days ago
#5diGet34
#devtodotnet#devto#dev#string#build
Long article (2154 words) — no AI summary yet.
Reading 0:00
15s threshold

Code reviews have a way of collecting comments that have nothing to do with whether the code works. A private field called lines where the reviewer expected _lines . A one-line if with no braces. Someone replies, someone else replies to the reply, and by the end of the thread two people who agree on everything that matters have spent their attention on the part that matters least.

The usual cure is a style document. A page gets written, everyone agrees with it, and the same comments keep appearing in review, because a page cannot fail a build.

The guide I'm introducing here takes the other road. Each rule names the setting that makes the compiler or the editor check it, where one exists, so most of those comments become build errors on the author's machine before a reviewer sees the diff.

What the guide is

The C# Code Style Wiki is free and open on GitHub, and it is also published as a site. It gives one answer per C# style question.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.