1
0
Fork 0
forked from fun/fun

Holiday is over, now I have fun again. No code changes. (0.38.11)

This commit is contained in:
Johannes Findeisen 2026-02-18 17:39:10 +01:00
commit f896e1d3bf
13 changed files with 329 additions and 0 deletions

25
docs/style-guide.md Normal file
View file

@ -0,0 +1,25 @@
# Fun Style Guide
Conventions for writing C and Fun code in this repository.
## General principles
- Two-space indentation. No tabs.
- Keep lines reasonably short (~100 cols). Wrap thoughtfully.
- Prefer explicit over implicit; favor clarity.
## C (C99)
- Indentation: two spaces, K&R-ish braces.
- Naming: `snake_case` for functions and variables; `CAPS_SNAKE` for macros.
- Error handling: return error codes or booleans; avoid hidden globals.
- Headers: minimize includes in headers; forward-declare where practical.
- Memory: clearly document ownership; free what you allocate.
## Fun language
- Indentation: two spaces.
- Naming: `snake_case` for functions/variables; `PascalCase` for classes/constructors.
- Modules: one primary concept per file; export a minimal, cohesive API.
- Idioms: prefer arrays and maps over ad-hoc structures; keep functions small.
## Formatting and tools
- No auto-formatters required; follow these simple rules.
- Keep diffs small and focused; avoid reformat-only commits.