Newer versions of C# allow file-scoped namespaces. Instead of creating basically double brackets to accommodate namespace + class.
using Sytem;
namespace Prowl
{
public class MyClass
{
public void MyMethod()
{
DoStuff();
}
}
}
become
using Sytem;
namespace Prowl;
public class MyClass
{
public void MyMethod()
{
DoStuff();
}
}
Advantages:
Less indentation
easier to read on Discord or narrow chats
most IDEs try to split lines above 80 character
Cleaner code
Most of the conversion is done only once
Disadvantages:
HUGE diff when updating all files, since most of the code base was using the old style. The commit will alter basically all lines of all files.
Because one might be annoyed, it's recommended to do during a big rewrite of the code, like the current development branch. I suggest to each developer to express opinion.
Tasks
quite simple
[x] Convert all files to file scoped namespaces
[x] include a rule inside .editorconfig to raise warnings when using normal brackets
Newer versions of C# allow file-scoped namespaces. Instead of creating basically double brackets to accommodate namespace + class.
become
Advantages:
Disadvantages:
Because one might be annoyed, it's recommended to do during a big rewrite of the code, like the current
development
branch. I suggest to each developer to express opinion.Tasks
quite simple
.editorconfig
to raise warnings when using normal brackets