[Olsr-dev] questions regarding v2 coding style / lang
Henning Rogge
(spam-protected)
Mon Sep 8 08:27:17 CEST 2008
My suggestions for coding style are simple:
No (or nearly no) macros except for constants. Most macros make the code
unreadable and difficult to debug.
No code in header files, it does belong into the source files.
No "source code compression". There is no reason the write extra tricky source
code only because it saves a few lines if the longer (and more readable) code
would result in a similar binary.
No scripts to create code. Generated code is a nightmare to read and to debug.
Doxygen comments for all functions (we have done this for most functions).
Clear namespaces for all functions/global variables in a .c file. Maybe a
common prefix which is a "compressed" but easy to recognize version of the
filename itself ( I use the prefix "pbb_" for all packet_bb parser
functions).
Henning
*************************************************
Diplom Informatiker Henning Rogge
Forschungsgesellschaft für
Angewandte Naturwissenschaften e. V. (FGAN)
Neuenahrer Str. 20, 53343 Wachtberg, Germany
Tel.: 0049 (0)228 9435-961
Fax: 0049 (0)228 9435-685
E-Mail: (spam-protected)
Web: www.fgan.de
************************************************
Sitz der Gesellschaft: Bonn
Registergericht: Amtsgericht Bonn VR 2530
Vorstand: Dr. rer. nat. Ralf Dornhaus (Vors.), Prof. Dr. Joachim Ender
(Stellv.)
More information about the Olsr-dev
mailing list