Hacker News new | past | comments | ask | show | jobs | submit login
Google-styleguide (code.google.com)
71 points by yters on Sept 19, 2009 | hide | past | favorite | 13 comments



Hm, while the python style guide is interesting and contains good advices, I am missing a reference to PEP8.


Speaking of PEP8, I find it strange that the guide mentions "Indent your code blocks with 4 spaces.". AFAIK Google used 2 spaces for indentation.


Unless I'm crazy, we still do. These guides differ from the internal guides in various strange ways.

I'm pretty sure these are the coding standards for code released outside of Google. For various disgusting historical reasons Python written internally spits in the face of PEP8 naming conventions. (And other weird niggles.)


They use 2 spaces for C++ and ObjC, 4 spaces for Python.


I was talking about the previous standard. Here's a proof: http://code.google.com/p/soc/wiki/PythonStyleGuide#Indentati.... It says:

Note that this differs from PEP8 and instead follows the original Google Python Style guide from which this style guide originated.

Indent your code blocks with 2 spaces.


And the java style guide?!?! Google has invested a lot in java projects, I don't think they don't care about the style there. Strange...


You have no idea. There has been a thread raging for the past week on checked exceptions. An earlier war raged over 80 vs 100 columns.


Perhaps there's no reason for a Google specific Java style guide because the Java style guide from Sun is pretty good.


There is a Google-specific guide. Its mostly of the form "go read the Sun style guide", with some specific clarifications of things the Sun style guide is quiet on.


The C++ guide interestingly recommends not using a number of language features (exceptions for instance) and advises a more standard-like approach on Windows. I wonder what seasoned windows programmers make of it http://google-styleguide.googlecode.com/svn/trunk/cppguide.x...


I was reading that the worst problem of C++ is to decide what 10% of the language to use in your project. Google is trying to do this to avoid such conflicts.


Too bad there's no .vimrc :-)


they have one; I might have it around somewhere but it's probably missing a lot




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: