aboutsummaryrefslogtreecommitdiffhomepage
path: root/DEVELOPMENT.md
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-04-27 22:50:47 +0200
committercbdev <cb@cbcdn.com>2020-04-27 22:50:47 +0200
commit1d8ed32bf769bc99095cd32ec166e681437607f0 (patch)
treebc94fd3a0245e91c15659916fc1c3591c7fb44b7 /DEVELOPMENT.md
parentd4714dfdd5c6e2d165d1ad9327fdce69a1b2b85b (diff)
parentc0bb55ff08faf2f89af947090d1c9bc412927d9f (diff)
downloadmidimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.tar.gz
midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.tar.bz2
midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.zip
Merge branch 'master' into debian/master
Diffstat (limited to 'DEVELOPMENT.md')
-rw-r--r--DEVELOPMENT.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
new file mode 100644
index 0000000..79005a9
--- /dev/null
+++ b/DEVELOPMENT.md
@@ -0,0 +1,50 @@
+# MIDIMonster development guide
+
+This document serves as a reference for contributors interested in the low-level implementation
+of the MIDIMonster. It is currently a work in progress and will be extended as problems come
+up and need solving ;)
+
+## Basics
+
+All rules are meant as guidelines. There may be situations where they need to be applied
+in spirit rather than by the letter.
+
+### Architectural guidelines
+
+* Change in functionality or behaviour requires a change in documentation.
+* There is more honor in deleting code than there is in adding code.
+ * Corollary: Code is a liability, not an asset.
+ * But: Benchmark the naive implementation before optimizing prematurely.
+* The `master` branch must build successfully. Test breaking changes in a branch.
+* Commit messages should be in the imperative voice ("When applied, this commit will: ").
+* The working language for this repository is english.
+* External dependencies are only acceptable when necessary and available from package repositories.
+
+### Code style
+
+* Tabs for indentations, spaces for word separation
+* Lines may not end in spaces or tabs
+* There should be no two consecutive spaces (or spaces intermixed with tabs)
+* There should be no two consecutive newlines
+* All symbol names in `snake_case` except where mandated by external interfaces
+* When possible, prefix symbol names with their "namespace" (ie. the relevant section or module name)
+* Variables should be appropriately named for what they do
+ * The name length should be (positively) correlated with usage
+ * Loop counters may be one-character letters
+ * Prefer to name unsigned loop counters `u` and signed ones `i`
+* Place comments above the section they are commenting on
+ * Use inline comments sparingly
+* Do not omit '{}' brackets, even if optional (e.g. single-statement conditional bodies)
+* Opening braces stay on the same line as the condition
+
+#### C specific
+
+* Prefer lazy designated initializers to `memset()`
+* Avoid `atoi()`/`itoa()`, use `strto[u]l[l]()` and `snprintf()`
+* Avoid unsafe functions without explicit bounds parameters (eg. `strcat()`).
+
+# Build pipeline
+
+# Architecture
+
+# Debugging