Skip to content

Contributing Code Style

Starciad edited this page Jan 31, 2026 · 3 revisions

We follow the Microsoft C# coding conventions, with some exceptions.

Main Preferences

  1. Use this to reference fields and properties
  2. Avoid asynchronous code in inappropriate contexts

Other Preferences

  1. Do not use var

  2. Mark immutable fields as readonly

  3. Use internal and public sparingly

  4. Utilize object initializers whenever possible

  5. All created constants must be strictly in the constants directory in some file

  6. All source code files must include the following license header at the top:

    /*
     * Copyright (C) 2023  Davi "Starciad" Fernandes <davilsfernandes.starciad.comu@gmail.com>
     * 
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     * 
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     * 
     * You should have received a copy of the GNU General Public License
     * along with this program. If not, see <https://www.gnu.org/licenses/>.
    */
  7. Use the automatic code cleaner provided by Visual Studio whenever possible to ensure your code aligns with the project's styling guidelines

Inline out Declarations

Prefer inline form for out declarations: SomeOutMethod(42, out PType value);

Clone this wiki locally