Skip to content

AuthMe Coding Styleguide

ljacqu edited this page Nov 23, 2015 · 3 revisions

General coding guidelines

  • Use indentation of four spaces
  • Always wrap structures like if, while with braces (never if (isTrue) doThis();)
  • Fields should not be public – use getters and setters where appropriate
  • Max line width: 120 characters

As usual in Java:

  • Class names should be uppercase and in CamelCase
  • Names of methods, fields and variables in lowercase and camelCase

JavaDoc

Use the imperative mood for verbs: "Get the player's name". JavaDoc should briefly explain what the method does and provide additional information to the developer.

Put an empty line between the description and the first @param, and between the last @param and @return.

Example:

    /**
     * Add a permission node required to execute this command.
     *
     * @param permissionNode The permission node to add.
     *
     * @return True on success, false on failure.
     */
    public boolean addPermissionNode(String permissionNode)