JagerDesu wrote: |
---|
If a condition can go without brackets, don't unnecessarily put brackets |
I disagree, I
always put
braces, even if there is 1 statement, and especially even if it is a null statement (which has a comment as well). This will save you one day when you add more code. I have seen plenty of examples of those who do exactly that, and wonder why things don't work :+)
My biggest bug bear is those who over-abbreviate their variable and function names.
I wish more people would format their parameter lists with 1 parameter per line, rather than them all on one line and overflowing into the next one. The compiler doesn't care about newlines in the code, it's really only interested in the semi-colon to denote the end of the statement. I much prefer formatting to make code readable, rather than some phobia about "Our code is the same, but yours takes up 80 LOC, versus mine which is only 50 LOC, so mine is better".
Am not a fan of really long
std::cout
statements either, people seem to forget they can build them up in stages, even if the output is 1 line. There is a kind of a rule about restricting code to 80 chars per line. In the old days, this was so one could print it on paper, but I dislike having to scroll 2 or 3 screens left and right in order to read the code.
Also not a fan of:
People Who((Run*everything)-together[like_this]);
I would prefer some spaces:
People WhoDont ( (Run * everything) - together[like_this] );