Skip to content

Formatting & Readability

NautRobot edited this page Nov 18, 2025 · 1 revision

📐 Formatting & Readability

These rules ensure visual consistency and code clarity across all files.

2.1 Braces (K & R Style)

Braces ({, }) follow the K & R style (Egyptian Brackets):

  1. The opening brace is on the same line as the construct it belongs to, preceded by a single space.
  2. The closing brace is on its own line, except when followed by else, catch, or a semicolon.

Example:

public void periodic() {
    if (isAtTarget()) {
        changeState(HallwayState.STOP);
    } else {
        // Continue movement
    }
}

Clone this wiki locally