dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
496 stars 191 forks source link

Discussion: Clean up repo code style #6941

Open DustinCampbell opened 2 years ago

DustinCampbell commented 2 years ago

There are a lot of style choices in the razor-tooling code base made by previous maintainers that don't necessarily align with the current maintainers. Let's use this issue to discuss some style changes that we'd like to make.

A good example is brought up here. Throughout razor-tooling code, a pattern is followed where the result of a method is first assigned to a local variable and then the variable is returned, presumably to aid in setting breakpoints. Is this style advantageous any longer? These days, the IDE allows breakpoints to be set on the closing brace of a method and the return value is shown in the debugger.

Additionally, we should decide on whether we want to use file-scoped namespaces and/or take advantage of implicit usings (#6895).

DustinCampbell commented 1 year ago

Another style choice to get consistent on: throw new ArgumentNullException(...). Should we use many lines or one? :smile:

https://github.com/dotnet/razor-tooling/pull/7001#discussion_r998651107