MaJerle/c-code-style
FreeRecommended C code style and coding rules for standard C99 or later
About MaJerle/c-code-style
A comprehensive C code style guide for C99 and later (C11 recommended) by Tilen MAJERLE. The repository provides detailed coding rules, conventions, and best practices for writing clean, consistent C code. It includes configuration files for clang-format, Artistic Style (astyle), and Eclipse CDT formatter, enabling automatic code formatting. The guide covers naming conventions, comments, functions, variables, structures, enumerations, typedefs, compound statements, switch statements, macros, and preprocessor directives. It also offers VSCode integration instructions using the built-in clang-format tool, and includes template source files for headers and implementations. The project is licensed under MIT and hosted on GitHub.
Key Features
Pros & Cons
- Well-documented with a logical structure and table of contents
- Includes practical configuration files for multiple popular formatters
- Emphasizes the single most important rule: imitate the surrounding code
- Active and maintained (over 100 commits, recent updates)
- Open source and free to use under MIT license
- Opinionated style may not suit all projects or teams
- Focuses only on C, not applicable to other languages
- Requires manual adoption and setup of the provided formatter configs