diff options
Diffstat (limited to 'CODE_STYLE.md')
| -rw-r--r-- | CODE_STYLE.md | 18 |
1 files changed, 18 insertions, 0 deletions
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` |