ProwlEngine / Prowl

An Open Source C# 3D Game Engine under MIT license, inspired by Unity and featuring a complete editor
MIT License
451 stars 38 forks source link

Code style: file scoped namespace #154

Closed brmassa closed 2 months ago

brmassa commented 2 months ago

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:

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

michaelsakharov commented 2 months ago

Im down for this, The reduction in Indentation would be nice. Especially for UI stuff, since the UI API generally results in very long lines.

brmassa commented 2 months ago

done