{"id":459,"date":"2012-06-26T01:18:01","date_gmt":"2012-06-26T01:18:01","guid":{"rendered":"https:\/\/halsafar.ca\/blog\/?p=459"},"modified":"2012-06-26T01:21:09","modified_gmt":"2012-06-26T01:21:09","slug":"googles-coding-style-guide","status":"publish","type":"post","link":"https:\/\/halsafar.ca\/blog\/2012\/06\/26\/googles-coding-style-guide\/","title":{"rendered":"Google&#8217;s Coding Style Guide"},"content":{"rendered":"<p>Regardless of personal preference you will often be forced to adapt to the coding style of someone else. \u00a0Generally this will be an enforced style at the company you work for. \u00a0Some see this as a minor annoyance. \u00a0I personally see this as important and practical. \u00a0It helps maintain code readability, this is important for new comers or looking back at your own code. \u00a0By making code more readable you also make it more understandable, this makes maintenance even easier. \u00a0 Decision about style have more impact than arguments like whether braces should be on the same line.<\/p>\n<p>The coding preference which most closely matched my habits turned out to be Google&#8217;s C++ Coding Guide. \u00a0This made most sense to me as I learned programming starting with C then C++. \u00a0In reality I started coding in BASIC on a Commodore 64 but that is a different story.<\/p>\n<p>I find this style guide has a lot of good habits one can derive from it.<\/p>\n<p><a title=\"Google Style Guide\" href=\"http:\/\/google-styleguide.googlecode.com\/svn\/trunk\/cppguide.xml\">Google&#8217;s C++ Style Guide<\/a><\/p>\n<p>There are some changes to the style I make, here are some important ones:<\/p>\n<ul>\n<li>Class members are all prefixed with an underscore<\/li>\n<li>Two spaces between functions implementations<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Regardless of personal preference you will often be forced to adapt to the coding style of someone else. \u00a0Generally this will be an enforced style at the company you work for. \u00a0Some see this as a minor annoyance. \u00a0I personally<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"https:\/\/halsafar.ca\/blog\/2012\/06\/26\/googles-coding-style-guide\/\">Read more <span class=\"screen-reader-text\">Google&#8217;s Coding Style Guide<\/span><span class=\"meta-nav\"> &#8250;<\/span><\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[65,64,61,63,22,66,62],"class_list":["post-459","post","type-post","status-publish","format-standard","hentry","category-developement","category-halsafar","tag-c","tag-employment","tag-google","tag-guide","tag-linkedin","tag-programming","tag-style"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts\/459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/comments?post=459"}],"version-history":[{"count":17,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts\/459\/revisions"}],"predecessor-version":[{"id":476,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/posts\/459\/revisions\/476"}],"wp:attachment":[{"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/media?parent=459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/categories?post=459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/halsafar.ca\/blog\/wp-json\/wp\/v2\/tags?post=459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}