From 28bf100a5076b4306fbf7d5e7974c356c081fcc8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 9 Jan 2017 17:04:41 +0100 Subject: [PATCH] doc/developer: more code style --- doc/developer.xml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/developer.xml b/doc/developer.xml index 82fe791d9..054228657 100644 --- a/doc/developer.xml +++ b/doc/developer.xml @@ -38,6 +38,12 @@ + + + comment your code, document your APIs + + + the code should be C++14 compliant, and must compile with @@ -46,15 +52,35 @@ + + + report error conditions with C++ exceptions, preferable + derived from std::runtime_error + + + + + + all code must be exception-safe + + + + + + classes and functions names use CamelCase; variables are + lower-case with words separated by underscore + + + Some example code: static inline int -foo(const char *abc, int xyz) +Foo(const char *abc, int xyz) { - if (abc == NULL) { + if (abc == nullptr) { LogWarning("Foo happened!"); return -1; }