> To bring closure to the story at the beginning of this post, the codebase that was breaking my brain had several anti-patterns, specifically related to items 1, 2, 3, 6, and 8 in the list above.
FYI: If you get into this situation in C#, the .editorconfig file and the "dotnet format" command are a godsend.
I inherited a very large, and complicated C# codebase with a lot of "novice" code and inconsistent style. I spent about 3 weeks adding rules to .editorconfig, running "dotnet format" and then manually cleaning up what it couldn't clean up. Finally, I added a Github Action to enforce "dotnet format" in all pull requests.
As a result: 1: The code was significantly more readable. 2: It trapped mistakes from everyone, including myself.
There are a few areas where we have to disable a rule via #pragma; but these are the exception, not the norm.
This is a good idea, and I also enforce something similar in my projects. I credit Go for popularising gofmt, including strong defaults and little customisation. My main complaint is that gofmt doesn't break lines.
FYI: If you get into this situation in C#, the .editorconfig file and the "dotnet format" command are a godsend.
I inherited a very large, and complicated C# codebase with a lot of "novice" code and inconsistent style. I spent about 3 weeks adding rules to .editorconfig, running "dotnet format" and then manually cleaning up what it couldn't clean up. Finally, I added a Github Action to enforce "dotnet format" in all pull requests.
As a result: 1: The code was significantly more readable. 2: It trapped mistakes from everyone, including myself.
There are a few areas where we have to disable a rule via #pragma; but these are the exception, not the norm.