Is google's C++ style guide any good?

IMO all their naming convention is shitty.

How I do it:


global variables:
G_STRING_variablename
G_ARRAYCHAR_variablename

local variables:
L_STRING_variablename
L_ARRAYINT_variablename

local pointer:
L_P_INT_variablename

parameters:
P_P_INT_variablename -> this one is a pointer
P_INT_variablename

This way is much easier to know whatever i'm dealing with.


Function names:

always with capslock: DO_XXX_YYY()

the notion of evaluating style guides by anything external or "objective" is retarded. it's useful as a way of framing your code so that it's internally consistent. the only real evaluation you can apply to it is essentially whether it contains any logical conflicts, like two conflicting rules applying to something.

the style guide is as good as anything else, but if you don't like it then use another one. if none exists, then use it for lack of an alternative.

You've obviously never had to work in the same project with a bunch of people.

The retarded shit I've seen justifies all the naming conventions you want.

Your style is shit and verbose and makes Hungarian look readable

Are you autistic?

whats the best c++ book?

You could just use a proper IDE. That way you know what you're dealing with without making your code a mess.

Also DON't use globals, holy shit.

i can see it now
for (std::vector::const_iterator L_STD__VECTOR__INT__CONST_ITERATOR_it = L_STD__VECTOR__INT.begin(); L_STD__VECTOR__INT__CONST_ITERATOR_it != L_STD__VECTOR__INT.end(); ++L_STD__VECTOR__INT__CONST_ITERATOR_it) {
DO_THIS_WITH_INT(*L_STD__VECTOR__INT__CONST_ITERATOR_it);
// etc
}

whoops, forgot the variable name for the vector

I avoid non-const global variables at all cost, name constants (whether global vars or object-like macros) WITH_NAMES_LIKE_THIS.

Regular variables, are namedLikeThis. asAreFunctionsAndMethods(). There's no special naming style for pointers as distinct from regular variables.

And classes have NamesLikeThis.

Fucking kill yourself.

>Function names:
>always with capslock: DO_XXX_YYY()
objectively retarded

>current year
>not using Rust
Enjoy your memory unsafety

hey now, I am hungarian

not related, it's called hungarian notation

back in the days, BCPL required this kind of faggotry, blame it on Simony Karcsibácsi, nowadays, its fugly and useless(plus nowadays most IDEs will cry out loud when you try to mess up data types)

/thread

> Don't use globals
Then what should i use, singletons? Lmao.

Quads checked...

I recall the shit storm about Hungarian notation from C++ MFC faggots. Happier times...

If you use C++ btw... fucking kill yourself.

most of c++ style guides have the same problems:
1) mix subjective and objective stuff
2) don't offer any working tooling to enforce stated rules
3) don't deal with pluralizm of the existing ecosystem

wew this should be a clear bait. AUTISM STYLE.

M E M E L A N G U A G E S

camelCase > shitty_unatural_to_type_underscrore

Looks like they are using notepad to code. Their naming scheme is a relic from decades ago.

No you pass the value along in the constructor where it is needed.