aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Thestrup <mithe24@student.sdu.dk>2025-11-30 14:00:00 +0100
committerMikkel Thestrup <mithe24@student.sdu.dk>2025-11-30 14:00:00 +0100
commit06be9b97b3cc575c69d037d6ba09950c0a53d7f3 (patch)
tree8838cc44c0bce89d830fd20ff10f478273a70f66
parent7a2b9870d9530c6ad080643b9fe72bb4e8e9335f (diff)
downloadcycle-detector-06be9b97b3cc575c69d037d6ba09950c0a53d7f3.tar.gz
cycle-detector-06be9b97b3cc575c69d037d6ba09950c0a53d7f3.zip
Added section about file naming conventions to style guide
-rw-r--r--CODE_STYLE.md18
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`