Commit 28bf100a authored by Max Kellermann's avatar Max Kellermann

doc/developer: more code style

parent accbd4e8
......@@ -40,6 +40,12 @@
<listitem>
<para>
comment your code, document your APIs
</para>
</listitem>
<listitem>
<para>
the code should be C++14 compliant, and must compile with
<application>GCC</application> 4.9 and
<application>clang</application> 3.4
......@@ -48,13 +54,33 @@
<listitem>
<para>
report error conditions with C++ exceptions, preferable
derived from <varname>std::runtime_error</varname>
</para>
</listitem>
<listitem>
<para>
all code must be exception-safe
</para>
</listitem>
<listitem>
<para>
classes and functions names use CamelCase; variables are
lower-case with words separated by underscore
</para>
</listitem>
<listitem>
<para>
Some example code:
</para>
<programlisting lang="C">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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment