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. 关于普通定时器与高级定时器的 PWM输出的初始化的区别

    不管是普通定时器还是高级定时器,你用哪个通道,就在程序里用OC多少.比如CH3对应OC3 TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;  TIM_ ...

  2. C#中Directory.GetFiles() 函数的使用

    C#中Directory.GetFiles(string path , string searchPattern, SearchOption searchOption ) 获取path目录中所有文件 ...

  3. DLL和LIB的一些知识点(网上搜集)

    关于lib和dll的区别如下:(1)lib是编译时用到的,dll是运行时用到的.如果要完成源代码的编译,只需要lib:如果要使动态链接的程序运行起来,只需要dll.(2)如果有dll文件,那么lib一 ...

  4. Android 环境搭建

    一.Android 环境搭建 开发工具: Android Studio(开发工具,前提是先装 java JDK) 下载地址:http://www.androiddevtools.cn/   Oracl ...

  5. HTTP笔记整理(1)

    今天开始学习http协议,把自己从网上整理,自己理解的部分先发出来,共勉! (PS笔者小白一枚,如有理解性的错误,请指正告知,为感!!!) 一.  HTTP协议概念 所谓的“协议”是指,计算机在通信网 ...

  6. python string intern

    python  字符串是不可变的. 字符串pool会对 t "looklike" Python identifiers 字符串做intern缓存.

  7. Java 虚拟机并发编程

    chap 1. 竞争条件:不同的执行得到不同的结果.规避共享可变性(即对共享状态的修改)可避免不必要的竞争条件. chap 2. balance between 一致性.准确性和性能.过犹不及!线程数 ...

  8. storysnail的Linux串口编程笔记

    storysnail的Linux串口编程笔记 作者 He YiJun – storysnail<at>gmail.com 团队 ls 版权 转载请保留本声明! 本文档包含的原创代码根据Ge ...

  9. 我的ORM之六-- 批量

    我的ORM索引 很多时候,批量方案是解决性能的关键 批量插入 SqlBulkCopy 利用 SqlBulkCopy 是性能最高的方式 实现: var s = dbr.Menu.NewMyOqlSet( ...

  10. js模版引擎handlebars.js实用教程——each-循环中使用this

    返回目录 <!DOCTYPE html> <html> <head> <META http-equiv=Content-Type content=" ...