Coding convention

28 views
Skip to first unread message

Jari Komppa

unread,
Sep 16, 2013, 3:16:37 AM9/16/13
to sol...@googlegroups.com
I generally try to follow the following coding convention. (Sometimes
I slip from it, being lazy). I'd prefer if all code in the SoLoud
proper followed the same convention.

aAttribute (parameter)
mMemberVariable
gGlobalVariable
localVariable
CONSTANT_VALUE
functionName
ClassName

char *foo, bar, *baz;

int i;
for (i = 0; i < 10; i++)
{
if (i == 0 && gFoo > BAR)
{
foo();
}
}

switch (aFoo)
{
case 0:
bar(4 + x * (17 / y));
break;
}

In general, try to optimize for readability.
Use common sense.
When in doubt, write code that looks the same as the surrounding code.
In case of complex code, leave a comment, it'll save time from
everybody, including yourself, when you have to revisit the code.
Reply all
Reply to author
Forward
0 new messages