Skip to content
This repository was archived by the owner on Sep 24, 2023. It is now read-only.

Coding Practices

mnadareski edited this page Feb 18, 2016 · 8 revisions

Below is a list of coding practices for this project in no necessary order:

  • The proper way to use brackets { } is to put them on the next new line not next to the statement.

INCORRECT

for (int i = 0; i < 5; i++) {
    // code }

CORRECT

for (int i = 0; i < 5; i++)
{
    // code
}
  • Comment code as often as necessary to clarify what functions or code blocks do.
  • Avoid duplicating code. If the code is used within the same page multiple times, create a function and abstract it. Similarly, if code is duplicated across multiple pages, either put a function in one of the pages and call it from the other, or create a helper page and put the function in there.
  • A page should represent a single function or set of highly related functions. For example, a page should not contain importing and exporting DATs, but having two different files for exporting different types of DAT is unnecessary. If it's an edge case, contact the project lead for the official ruling.
Clone this wiki locally