C++ style notes (notes from Google C++ style guide)

Here are some of my notes taken from the C++ style guide from Google. It is a huge document, here I am trying to create a quick summary of ones that I find are more useful.

The full Google Style guide is here

https://google.github.io/styleguide/cppguide.html

From my past internship experiences, people usually want to follow certain style guide for a large code repository. Here is my attempt to train myself to follow a style guide in my PhD time.

  1. Local Variables
    1. Naming: variables and data members should all be lower case, with underscores between words (snake case). NOTE: data members of a class have training underscores, e.g. a_class_data_member_
    2. Declaration: Make sure the variables are initialized. They should be declared close to their uses.
    3. References:
      1. https://google.github.io/styleguide/cppguide.html#Variable_Names
      2. https://google.github.io/styleguide/cppguide.html#Local_Variables
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s