From 06be9b97b3cc575c69d037d6ba09950c0a53d7f3 Mon Sep 17 00:00:00 2001 From: Mikkel Thestrup Date: Sun, 30 Nov 2025 14:00:00 +0100 Subject: Added section about file naming conventions to style guide --- CODE_STYLE.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'CODE_STYLE.md') diff --git a/CODE_STYLE.md b/CODE_STYLE.md index ecbdbb3..cdcde75 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -200,3 +200,21 @@ if (result > 0) { } } ``` + +## File Names +- Use `snake_case` +- Use `.c` extension for source files. +- Use `.h` extension for header files. +- Example: `user_manager.c`, `user_manager.h`. + +## Naming Conventions +- Choose descriptive names that eeflect + the module's primary responsibility. +- Keep names concise but meaningful (typically 1-3 words). +- Avoid abbreviations unless they are widely recognized. +- Example: `config_parser.c` [good], `cfg_prs.c` [bad]. + +## Header File Guards +- Use `ifndef` guards with `UPPER_SNAKE_CASE`. +- Follow the pattern: `{FILENAME}_H` or `{FILENAME}_H_INCLUDED`. +- Example: `#ifndef USER_MANAGER_H` -- cgit v1.2.3-70-g09d2