Get your own compiler:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9
you can then compile using the command:
g++-4.9 -std=c++14 -Wall -Werror -O2 -o helloworld helloworld.cpp


Style Rules:

Macros should never be required in C++.
Variables should be defined close to their use.
Don’t use malloc/realloc, use new (or smart pointers)
Minimise use of void*, pointer arithmetic, union and c-style casts
Minimise the use of C-style arrays and strings, use vector/array (from C++11) and string instead.

总之,忘掉C语言。


C++ Standard Library

For efficiency reasons, STL is not object-oriented:

    • Makes little use of inheritance, and
    • Makes no use of virtual functions

The Standard Template Library (STL) is a part of the C++ standard library, Some others are:

分类一:

  • The C standard library
  • Language support: <exception>, <ctime>, ...
  • Strings: <string>, <cstring>, ...
  • Numerics: <cmath>, <complex>, ...
  • I/O: <iostream>, <fstream>, <cstdio>, ...
  • Exception classes
  • Smart pointers
  • Classes for internationalisation support

分类二:

Containers: vector, list, stack, ...
Algorithms: find, sort, copy, ...
Iterators are the glue between the two!


The compilation process:

1. Preprocessing - handles meta-information (e.g., #include)
2. Compiling - translates C++ into machine code objects
3. Linking - merges objects into a single application


Google 开源项目风格指南

对语言风格的实践就是最好的学习路径。明白了作者的风格定义思路,也就意味着语言学习达到了优良水准。

路漫漫其修远兮…… 除了坚持,没有捷径。Good luck!

[c++] Basic ideas and Style Guide的更多相关文章

  1. Google C++ Style Guide

    Background C++ is one of the main development languages used by many of Google's open-source project ...

  2. Airbnb JavaScript Style Guide

      Airbnb JavaScript Style Guide() { 用更合理的方式写 JavaScript    ES5 的编码规范请查看版本一,版本二. 翻译自 Airbnb JavaScrip ...

  3. Dojo Style Guide

    Contents: General Quick Reference Naming Conventions Specific Naming Conventions Files Variables Lay ...

  4. 与你相遇好幸运,The Moe Node.js Code Style Guide

    The Moe Node.js Code Style Guide  By 一个最萌的开发者 @2016.9.21 >>代码是人来阅读的,格式规范的代码是对编程人员最好的礼物 :) > ...

  5. 使用tdcss.js轻松制作自己的style guide

    http://jakobloekke.github.io/tdcss.js/ 在前端开发中,如果能够有一个style guide对于设计来说就显得专业稳定,一致性.在上述链接中,有一个tdcss.js ...

  6. Google C++ Style Guide在C++11普及后的变化

    转 http://www.cnblogs.com/chen3feng/p/5972967.html?from=timeline&isappinstalled=0&lwfrom=user ...

  7. Common Lisp Style Guide - Ariel Networks Labs

    Common Lisp Style Guide - Ariel Networks Labs Common Lisp Style Guide

  8. 一张图总结Google C++编程规范(Google C++ Style Guide)

    Google C++ Style Guide是一份不错的C++编码指南,我制作了一张比較全面的说明图,能够在短时间内高速掌握规范的重点内容.只是规范毕竟是人定的,记得活学活用.看图前别忘了阅读以下三条 ...

  9. PEP 8 – Style Guide for Python Code

    原文:PEP 8 – Style Guide for Python Code PEP:8 题目:Python代码风格指南 作者:Guido van Rossum, www.yszx11.cnBarry ...

随机推荐

  1. hdu 5945 Fxx and game

    青年理论计算机科学家Fxx给的学生设计了一款数字游戏. 一开始你将会得到一个数X,每次游戏将给定两个参数x,k,t, 任意时刻你可以对你的数执行下面两个步骤之一: .X=X−i(<=i<= ...

  2. iOS开发--Block

    iOS开发--Block 1.什么是Block,block 的作用 ui开发和网络常见功能实现回调,按钮的事件处理方法是回调方法以及网络下载后的回调处理 (1)按钮 target-action   一 ...

  3. FreeRTOS和Ucos在任务优先级的区别

    而ucos的任务优先级是任务优先级的数组越小,任务优先级越高.和STM32的中断优先级保持一样的分析,和freeRTOS相反.

  4. wpf下datagrid使用过程中需要注意的几点(一)

    MainWindow.xaml中的代码如下: <DataGrid CanUserAddRows="False" ItemsSource="{Binding}&quo ...

  5. [转] 编译安装GCC

    Linux下编写C/C++程序自然缺不了一个优秀的编译器,Linux下比较常见的自然是GCC了. 2015年GCC也出到了5.2.0版本,对于C++11/14也有了更好的支持了. 所以,今天我们就来说 ...

  6. java Map及Map.Entry详解

    Map是java中的接口,Map.Entry是Map的一个内部接口. Map提供了一些常用方法,如keySet().entrySet()等方法. keySet()方法返回值是Map中key值的集合:e ...

  7. 站在移动互联时代的十字路口上_deviceone

    最近总能看到类似“App已死,服务永生”.“App必死,web永生” .“App已死,微信建站已生”这样的文章.不晓得这些网络写手到底是想代表某些公司的立场.还是想要表达怎么样的一个情结,文章中语气都 ...

  8. Android怎么找到最优适配资源

    当我们将一些提供了不同的资源文件可供Android系统选择的时候,Android会在运行时会根据一套适配的规则选择最符合当前配置的资源.为了说明Android怎么选择资源,假设我们有以下可选的资源文件 ...

  9. 渣渣小本求职复习之路每天一博客系列——Java基础(9)

    ———————————————————————今天不闲聊————————————————————————————— 第十一章:线程 第四节:synchronized与同步 首先,我们来看一段代码: p ...

  10. Microsoft Dynamics CRM 2013 and 2011 Update Rollups and Service Packs

      Microsoft Dynamics CRM 2013   BTW: RC stands for Release for Candidate, and RTM stands for Release ...