Questions tagged [google-style-guide]

The Google Style Guide project holds the style guidelines googlers use for Google code.

Every major open-source project has its own style guide: a set of conventions (sometimes arbitrary) about how to write code for that project. It is much easier to understand a large codebase when all the code in it is in a consistent style.

“Style” covers a lot of ground, from “use camelCase for variable names” to “never use global variables” to “never use exceptions.” The Google Style Guide project holds the style guidelines we use for Google code. If you are modifying a project that originated at Google, you may be pointed to its page to see the style guides that apply to that project.

74 questions
0
votes
1 answer

Avoiding huge files when following python google-style-guide

Google style guide requires to import modules. Say I have a non trivial class and several non-trivial derived classes. It seems that I have to put them all in the one file otherwise will have to use different prefixes when using them. Personally I…
uuu777
  • 765
  • 4
  • 21
0
votes
1 answer

What is a code repository sub-package imports?

Looking at the Google Python Style Guide under 3.13 it says order of imports should be: Python Future Imports Python Standard imports Third Party module or package import Code repository sub-package imports What exactly is Code repository…
user7692855
  • 1,582
  • 5
  • 19
  • 39
0
votes
1 answer

Git commit convention

Should I remove the articles (a, the) when writing the git commit message? I found that a lot of commits often 'miss' the articles 'a' and 'the'. I checked the Google Style Guide but couldn't find the right answer. Is it just the committers missing…
Jiho Choi
  • 1,083
  • 1
  • 10
  • 26
0
votes
0 answers

Google C++ style guide on members of a base class

The Google C++ style guide states in the section about inheritance that: Limit the use of protected to those member functions that might need to be accessed from subclasses. Note that data members should be private. Consider now the following…
user2416984
  • 941
  • 1
  • 11
  • 18
0
votes
1 answer

Properly document a constructor passed as parameter

I'm trying to figure out what is the properly way to document a function that receives a class constructor as parameter . I'm using Google style docstring. Example: class MyClass: def __init__(self): ... def my_func(param1,…
0
votes
1 answer

Does a validator/linter for Google's HTML/CSS/JS style guides exist?

I've been looking around for ages, but I can't seem to find any validators for these. I'm looking for similar to PHP_CodeSniffer. I'm talking about the following style guides: HTML/CSS JavaScript Does anybody know of one (or some)? Am I just not…
Thierry
  • 101
  • 1
  • 7
0
votes
1 answer

GoogleNews CSS style

I want to create a news aggregator with an interface similar to GoogleNews. Very little experience with HTML/CSS, couldn't do it just with inspect. Is there any way to include (or download) the stylesheet, so I can create an interface similar to…
user1680859
  • 1,160
  • 2
  • 24
  • 40
0
votes
1 answer

How to force cppstyle to use c and h files?

I am using cpptyle within eclipse to check my code style within my C-Project. So my file extensions are *.c and *.h. cppstyle uses cpplint.py. The documentation of cpplint.py tells, that you have to use the extension parameter if you would like to…
eDeviser
  • 1,605
  • 2
  • 17
  • 44
0
votes
1 answer

Google Style Wizard

I beginning to use google style wizard, and i was wondering to know if it is possible coloring the streets (example: local street) in different colours by area determined. I would be really gratefull if you could tell me how to do it in android…
0
votes
0 answers

How is a "constant" defined with consideration to common Python coding style?

Constants are usually evident from ALL_CAPS names, and near the top of modules, however, it is not clear to me how one defines a constant. Is a constant: A) A reference to a value which is not intended to be changed throughout the life of the…
cammil
  • 9,499
  • 15
  • 55
  • 89
0
votes
1 answer

About the "Reference Arguments" rule in Google C++ Style

I'm converting my code to follow the google C++ style guide. The Reference Arguments rule says "All parameters passed by reference must be labeled const" and "input arguments are values or const references while output arguments are pointers". With…
lzl124631x
  • 4,485
  • 2
  • 30
  • 49
0
votes
1 answer

Is there a CSS style guide for large existing projects. Or how could I optimize the css for a large project

I am currently working on a large scale project with mutiple frontend and backend devs. It is basically a large e-commerce solution with different brands in mind that have the same core structure but different styles and layouts. My question is…
AlexForm
  • 77
  • 2
  • 7
-1
votes
1 answer

Java google-style indentation emacs file

I need to use google style indentation in Java Application. I was given code to add to my .emacs file but its not working. When I run the checkstyle code, it gives me tab errors. This is what my .emacs file contains: ;;…
user3541263
  • 219
  • 2
  • 5
  • 11
-5
votes
2 answers

Why does Google's R style guide recommend <- for assignment, rather than =?

I read the Google style guide for R. For "Assignment", they say: Use <-, not =, for assignment. GOOD: x <- 5 BAD: x = 5 Can you tell me what the difference is between these two methods of assignment, and why one is to be preferred over the…
Dr. Manuel Kuehner
  • 389
  • 1
  • 6
  • 16
1 2 3 4
5