Naming

Verze:

02. 07. 2025

Zodpovědná osoba:

Dominik Šlechta

Class names MUST be in PascalCase. Method and variable names MUST be in camelCase. Constant names MUST be in PascalCase.

Class Names Standard

In our codebase, class names MUST be declared using PascalCase. This convention aids in distinguishing class names from other types of identifiers at a glance.

Definition

PascalCase means starting each word with a capital letter, without spaces or underscores between words. It's also known as Upper Camel Case.

Example (Correct):

public class CustomerAccount {
    // Class name is in PascalCase
}

public class ShoppingCart {
    // Class name is in PascalCase
}

Example (Incorrect):

public class customerAccount {
    // Not using PascalCase
}

public class shopping_cart {
    // Not using PascalCase
}

Method Names Standard

For clarity and consistency, method names MUST be declared in camelCase. This standard applies across all our codebases, irrespective of the programming language.

Definition

camelCase starts with a lowercase letter, and each subsequent word starts with a capital letter, without spaces or underscores.

Example (Correct):

public void updateAccountBalance() {
    // Method name is in camelCase
}

private void saveUserPreferences() {
    // Method name is in camelCase
}

Example (Incorrect):

public void UpdateAccountBalance() {
    // Not using camelCase
}

private void save_user_preferences() {
    // Not using camelCase
}

Constant Names Standard

Constants within our codebase MUST be declared using PascalCase to maintain consistency with class naming conventions.

Definition

PascalCase for constants means starting each word with a capital letter, without spaces or underscores. Constants are distinguished by the const keyword rather than casing convention.

Example (Correct):

public static final int MaxUserCount = 100;

private static final String ApiKey = "your-api-key-here";

Example (Incorrect):

public static final int MAX_USER_COUNT = 100;

private static final String API_KEY = "your-api-key-here";

Variable Names Standard

To maintain a consistent and readable codebase, all variable names MUST be declared in camelCase. This convention applies to local and global variables alike.

Definition

camelCase for variable names starts with a lowercase letter, with each subsequent word beginning with an uppercase letter, without spaces or underscores.

Example (Correct):

int accountBalance;
String userName;

Example (Incorrect):

int AccountBalance; // Not using camelCase
String user_name;   // Not using camelCase