Spacing
tabs over spaces (I don't care too much about this, though)
Variables
variables should be written using camel case.
most languages have camel case as part of their standards, including C and C++ in none safety critical application, but barr cannot properly explain why camel case is objectively unsafe. I would also make the argument that most people that join this team with programming experience most likely have experience reading camel case.
Code Block | ||||
---|---|---|---|---|
| ||||
int youAreReadingThis = 0; int youAreReadingThis{0}; bool niceThanksForReading = false; bool niceThanksForReading{false}; double thisIsSuperFun = 0.0f; |
...
should be based on the number of characters, not the number of variables, but I think most of our code doesn't declare variables on the same line anyway so this isnt that important.
Breaks
if the loop is simple enough, I don't see a point in boolean flags. Sometimes Its easier to just look for the break statement than to look for what boolean is in the for loop condition, and where its being set. I think this should be done case by case. If the MIRA-C guide says no break statements, then I wont argue with it.
Functions
Naming and Brackets
...
Non-static member variables should use snake case.
Constants should use camel case with a
k
as the first character.Static variables should use snake case, but have a
_
as the first character.
these feel so backwards. variables should all use some form of camel case. If you want to prepend an s to static, that works. Make sure to reference all members properly in functions though, (a lot of our code, even the old code we inherited, doesnt reference class variables properly.
...