Open gluxon opened 10 years ago
I suggest agreeing on the more basic questions to start
Regarding #3, I personally think code should be written like a coherent essay. New ideas or commands that affect different areas of the robot should be separated by a line.
I'm writing this as a separate comment since I'm almost certain everyone here doesn't really believe coding conventions are that important.
Let me summarize why they are:
Don't end up like Apple. They had a critical bug in their security very recently that could have been solved by someone reviewing their code for coding conventions. Check it out, it's quite hilarious and I challenge everyone to see if you can find the bug. (It's really simple.)
My opinion:
omit blocks when possible space operators if you feel like hit tab to indent and always keep indents nice
set these as your NetBeans Formatting prefs and liberally highlight + Alt+Shift+F
indent/newline function arguments if too much crazy is going down newline every statement unless there's a reason you shouldn't don't under any circumstance 80 character wrap cause we have modern screens capable of displaying more than that.
that's all you gotta do
Please don't change my formatting for me :)
I hope you don't mind that I updated your comment to demonstrate how much easier it is to read as bullets rather than a very large sentence with 6 comma splices. (I'm sorry. Not to pick on you personally but it was a perfect example I couldn't miss. Hope this doesn't come off as devilish and mean :heart:)
@ThatTreeOverThere
@gluxon Not omitted:
if( branch ) {
return true;
} else {
return false;
}
Omitted:
if( branch )
return true;
else
return false;
Blocks are different from braces though.
It's important in a programming team that everyone agrees on a language to use within the programming language chosen. This way, the code base isn't an unfamiliar jungle in its different parts to newcomers.
The general rule for coding style is that code is written in the way that it takes the least amount of mental effort and energy to decipher its intentions. Consider the basic indent example:
vs
-- from http://en.wikipedia.org/wiki/Programming_style#Code_appearance