Feed on
Posts
Comments

Archive for the 'Cplusplus' Category

(Update below)
At the time of writing this, the Mozilla Coding Style guidelines have this recommendation under “General C/C++ Practices”:
Don’t put an else right after a return. Delete the else, it’s unnecessary and increases indentation level.
I can appreciate this in some circumstances, such as when checking for an error case early in a long function:
void f()
{
[...]

Everyone knows that global variables are bad and should be avoided wherever possible.  Why?  Because each global variable is, in effect, an implicit argument to every function that can see the global variable.  The same thing is true of any non-local state.
And the presence of non-local state means that you can’t reason locally about your [...]