exeterOP•

I find it most interesting that there's no Javascript, Java, or Python styleguide in the lot (just C, C++, and Obj-C).

3
snprbob86•

Yet public.

Google maintains a internal database of developers which have earned "readability" approval on a per-language basis. There are strict style guides for all supported languages at Google.

2
mvferrer•

Perhaps this Google Python style guide might help with figuring out how Google's looks like.

Quoted from one of Todd Larsen's comments:

This style guide was derived from the Google Python Style guide, which is pre-Guido-joining-Google era. The only thing we changed from that style guide is to use Java-style method names (and functions), with an initial lowercase followed by camel-case. The Google Python Style Guide uses the same style (full camel-case) for both class names and method names (and functions).

3
[deleted]•

[deleted]

2
crucini•

Hmmm.

class       PuppyDog
variable    puppy_dog
constant    kPuppyDog
function    ChewBone()
setter      set_weight()
getter      weight()
private var weight_
macro       BARK_LOUDLY

The different styles of function naming irk me. I can see where this scheme has value when consistently applied.

But:

... eschew abbreviation ... So, no "HTTP" or "SMTP" in your code? Or is there a threshold here?

class ParallelHypertextTransferProtocolClient {
2
[deleted]•

No, they mean something like ParallelHttpClient. Way more readable than ParallelHTTPClient, and you still know what's going on. You can probably assume (though I've been proven wrong on so many assumptions about programmers) that any sufficiently technical person knows what "http" means, regardless of capitalization :)

1
crucini•

You're right. From http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#General_Naming_Rules:

int num_dns_connections;  // Most people know what "DNS" stands for.

But then I noticed:

Never abbreviate by leaving out letters: int error_cnt; // Bad.

Isn't "num" an abbreviation for "number", formed by leaving out letters?

1
asegura•

I don't like capitalized function names. Remind me Microsoft style. Capitalized identifiers are types (classes or other).

For me: ClassName, functionName(), variableName, CONSTANT_NAME (from enum or const or define), _privateMember (if colliding with accessor).

1
chneukirchen•

ClassName, function_name, variable_name, CONSTANT_NAME, _private_usually_not_like_that.

6
guapoo•

Both of you need to STOP IT ALREADY with the leading underscores. It's in the goddamned standard.

17.4.3.1.2 (page 383)

You may notice that the rule only applies to names at global scope, but overriding in a local scope could break a poorly-written macro. Use an m or a trailing underscore.

0
dorel•

an Emacs settings file for Google style.

but nothing for vim :-(

1