17 Sep
2013
17 Sep
'13
2:04 p.m.
2013/9/16 Johan Engelen <jbc.engelen@...2592...>:
Hi all, There are some errors in the coding style page I believe. Two big issues:
namespace Inkscape { namespace UI { Sandwich make_sandwich(int x); int make_a_mess(float y); } }
instead of
namespace Inkscape { namespace UI { Sandwich make_sandwich(int x); int make_a_mess(float y); } }
This is totally inconsistent with how other namespaces are indented.
For these kind of forward declarations, I think it is much clearer to indent. Not for class definitions etc.
And
switch (a) { case 1: do_one(); break;
instead of
switch (a) { case 1: { do_one(); break; } ... default: break; }
This leads to excessive indent, especially with nested switches, as seen in event context code.
Switch labels should not be indented at all, like private/public labels in classes, so your example would look like:
switch (a) { case 1: do_one(); break; case 2: do_two(); break; }
Regards, Krzysztof