Coding guidelines for people who submit to the SVN (based on initial email by m0skit0). Coders feel free to comment.
The SVN is currently split in two: the trunk, and a branch named "p5" (partition 5). We expect the branch to contain experimental code and the trunk to be pretty stable.
- Don't mass code. Space it, let some air pass in the code, it will prevent code from overheating xD
- Tabs have 4 spaces, set your editors accordingly. It is also fine to set your editor so that it replaces tabs with 4 spaces.
- Brackets go on new line, not at end of the line.
- The more comments, the better.
- Avoid global variables. If you really need globals, put them in the structure defined in globals.h. See this ticket for more info.
- There's a "test" homebrew included in the trunk. Run this homebrew with HBL. If that homebrew reports errors with your code, DON'T SUBMIT your code to the SVN.
@m0skit0: I personally disagree with the following rule so for the time being I'm not including it:
All variable declarations at the start of the function, so we easily know how much stack is allocated on each function.
I think there is no reason for that, since the space on the stack is quite huge last time I checked. So we have very little risk of an overflow there. Rather, I'd prefer variables to be declared only when they are needed, to narrow their scope and avoid scope bugs. We can discuss this if you want.