diff --git a/Coding-Style.md b/Coding-Style.md index 7ff511d..0b281a5 100644 --- a/Coding-Style.md +++ b/Coding-Style.md @@ -8,4 +8,40 @@
+This document discusses practices and style for programmers working on the BigWhoop compression library. The Guidelines are based on the C Coding Style recommended by the GNOME Developer Documentation and should be followed to promote a consistent, readable, and maintainable code base. The Guide offers solutions to common C, python and cmake programming issues and illustrates through examples of code +
+ +## Content +- [The Single Most Important Rule](#the-single-most-important-rule) +- [Formatting](#formatting) + - [Indentation](#indentation) + - [Braces](#braces) + - [Functions](#functions) + - [Derived Types](#derived-types) +- [Comments](#comments) +- [Syntactic Conventions](#syntactic_conventions) +- [Names](#names) + +## The Single Most Important Rule +Above all, the following rule from the GNOME developer documentation should always be followed. +>The single most important rule when writing code is this: check the surrounding code and try to imitate it. +> +>As a maintainer it is dismaying to receive a patch that is obviously in a different coding style to the surrounding code. This is disrespectful, like someone tromping into a spotlessly-clean house with muddy shoes. +> +>So, whatever this document recommends, if there is already written code and you are contributing to it, keep its current style consistent even if it is not your favorite style. +> +>Most importantly, do not make your first contribution to a project a change in the coding style to suit your taste. That is incredibly disrespectful. + +## Formatting +Keep the length of source code lines to 100 characters or less to ensure maximum readability on most modern monitors with a reasonable font size. Longer lines of code are more difficult to read and understand. Too many indentations should be interpreted as an indication that code restructuring is required. +### Indentation + +### Functions +### Derived Types + +## Comments +## Syntactic Conventions +## Names \ No newline at end of file