Is this a good c++ style guidance:
http://geosoft.no/development/cppstyle.html
I am trying to change my style to be constant.
There are many common C++ practices in the "community". Camel case is
far from the most popular. In fact, using it can get you into trouble
if you're coding on windows systems.(1,2,6,etc...)
The all-caps constants thing has been beat to death already.
Requiring single letter template parameter names is just plain fucking
stupid. REALLY fucking stupid. (8)
Requiring variables to be named exactly the same as their type is also
really fucking dumb. (12)
Although regarding the example I'd probably agree, the reasoning behind
15 is only true because they're already being dumbasses via 12.
Getters and setters are smelly. That this group has an actual naming
convention for them is dubious. Requiring get/set as prefixes is just
silly, especially since C++ does overloading.(17)
Using i,j,k,etc.. for iterator value names is a questionable practice.
Many people do in fact do it, because it's just easy and fairly well
recognized, but its a lazy practice and should certainly not be
recommended/required by a team style guide. Quite frankly, if you find
yourself using more than just 'i' then you need REAL names for your
iteration variables. (25)
Everything about #33 is insane.
I totally disagree with the examples in #39. COMMA FIRST!
function( param1
, param2
, param3 )
If you're going to split, do it. Don't mix and match; it's much harder
to read.
The exception to #46 should not be allowed.
#47 should certainly be followed and should go without saying.
Unfortunately on some teams it does not.
#57 is dumb. If you have to scroll down to reach the while in a
do-while then other, more important practices are not being followed
(keep things short by factoring into smaller functions).
#60 is just silly.
All in all this is a terrible style guide. There are some good bits in
it but too many bad bits and the entire thing is more about formatting
than about real, important issues. For example, a good style guide
would say something like:
"Always assign new pointers to RAII objects immediately and on a single
line by themselves. Example:
std::auto_ptr<x_type> x(new x_type);
std::auto_ptr<y_type> y(new y_type);
function(x,y);
// NOT function(std::auto_ptr<x_type>(new x_type), ...);"
Things like this actually effect the *functionality and correctness* of
code (works around unknowable order of parameter execution in this
case), which any good style guide should have as its main focus. This
guide of yours doesn't even have a single item like this in it.
This entire guide that you're linking to violates item 0 of "C++ Coding
Standards" by Sutter & Alexandrescu (a GOOD style guide): Don't Sweat
the Small Stuff. Almost 100 items of mostly crap because they're too
worried about whitespace. The entire thing could be summed up in one
rule: "Make your fucking code make fucking sense to human fucking beings!"