[chbot] C Coding Style

Robin Gilks robin at gilks.org
Fri Sep 23 04:31:28 BST 2016


>
Seeing some interesting assumptions here.

Use of macro #define ALL_UPPER_CASE
Space between 'if' and '('
Indent of '{' at same level as 'if' and 'else'

I wonder if peeps do as I do and
  * have the first few letters of a function name associated with the
module within which it resides
  * use upper case for #defines
  * use underscores in variable names but camel case in function names
  * if a simple 'for' loop then the 'increment_number' is 'i' (unless it
does more than count or index an array)

Just checked my Eclipse->Window->Preferences->C/C++->CodeStyle->Formatter
and I see my own template is not quite GNU - it must be llama !!

-- 
Robin Gilks





More information about the Chchrobotics mailing list