1. 让自己习惯C++(Accustoming yourself to C++)
  条款01: 视C++ 为一个语言联邦(View C++ as a federation of languages)
  条款02: 尽量以const,enum,inline替换#define(Prefer consts,enums,and inlines to #define)
  条款03: 尽可能使用const(Use const whenever possible)
  条款04: 确定对象被使用前已先被初始化(Make sure that objects are initialized before they’re used)
2. 构造/析构/赋值运算(Constructors,Destructors, and Assignment Operators)
  条款05: 了解C++ 默默编写并调用哪些函数(Know what functions C++ silently writes and calls)
  条款06: 若不想使用编译器自动生成的函数,就该明确拒绝(Explicitly disallow the use of compiler-generated functions you do not want)
  条款07: 为多态基类声明virtual 析构函数(Declare destructors virtual in polymorphic base classes)
  条款08: 别让异常逃离析构函数(Prevent exceptions from leaving destructors)
  条款09: 绝不在构造和析构过程中调用virtual 函数(Never call virtual functions during construction or destruction)
  条款10: 令operator= 返回一个reference to *this(Have assignment operators return a reference to *this)
  条款11: 在operator= 中处理”自我赋值”(Handle assignment to self in operator=)
  条款12: 复制对象时勿忘其每一个成分(Copy call parts of an object)
3. 资源管理(Resource Management)
  条款13: 以对象管理资源(use objects to manage resources)
  条款14: 在资源管理类中小心 copying 行为(Think carefully about copying behavior in resource-managing classes)
  条款15: 在资源管理类中提供对原始资源的访问(Provide access to raw resources in resource-managing classes)
  条款16: 成对使用new 和delete 时要采取相同形式(Use the same form in corresponding uses of new and delete)
  条款17: 以独立语句将newed 对象置入智能指针(Store newed objects in smart pointers in standalone statements)
4. 设计和声明(Designs and Declarations)
  条款18: 让接口容易被正确使用,不易被误用(Make interfaces easy to use correctly and hard to use incorrectly)
  条款19:设计class犹如设计type(Treat class design as type design)
  条款20:宁以pass-by-reference-to-const替换pass-by-value (Prefer pass-by-reference-to-const to pass-by-value)
  条款21: 必须返回对象时,别妄想返回其reference(Don’t try to return a reference when you must return an object)
  条款22: 将成员变量声明为private(Declare data members private)
  条款23: 宁以non-member、non-friend 替换member 函数(Prefer non-member non-friend functions to member functions)
  条款24: 若所有参数皆需类型转换,请为此采用non-member 函数(Declare non-member functions when type conversions should apply to all parameters)
  条款25: 考虑写出一个不抛异常的swap函数(Consider support for a non-throwing swap)
5. 实现(Implementations)
  条款26: 尽可能延后变量定义式的出现时间(Postpone variable definations as long as possible)
  条款27: 尽量少做转型(Minimize casting)
  条款28: 避免返回handles指向对象内部成分(Avoid returning”handles” to object internals)
  条款29: 为“异常安全“努力是值得的(Strive for exception-safe code)
  条款30: 透彻了解inlining的里里外外(Understand the ins and outs of inlining)
  条款31: 将文件间的编译依存关系降至最低(Minimize compilation dependencies between files)
6. 继承和面向对象设计(Inheritance and Object-Oriented Design)
  条款32:确定你的public 继承塑模出is-a关系(Make sure public inheritance models “is-a”)
  条款33:避免遮掩继承而来的名称(Avoid hiding inherited names)
  条款34: 区分接口继承和实现继承(Differentiate between inheritance of interface and inheritance of implementation)
  条款35: 考虑virtual函数以外的其他选择(Consider alternatives to virtual functions)
  条款36: 绝对不要重新定义继承而来的non-virtual函数
  条款37: 绝对不要重新定义继承而来的缺省参数值(Never redefine a function’s inherited default parameter value)
  条款38:通过复合塑模出has-a或“根据某物实现出”(Model “has-a” or “is-implemented-in-terms-of” through composition)
  条款39: 明智而审慎地使用private继承(Use private inheritance judiciously)
  条款40:明智而审慎地使用多重继承(Use multiple inheritance judiciously)
7. 模板与泛型编程(Templates and Generic Programming)
  条款41:了解隐式接口和编译期多态(Understand implicit interfaces and compile-time polymorphism)
  条款42:了解typename的双重意义(Understand the two meanings of typename)
  条款43:学习处理模板化基类内的名称(Know how to access names in templatized base classes)
  条款44:将与参数无关的代码抽离templates(Factor parameter-independent code out of templates)
  条款45:运用成员函数模板接受所有兼容类型(Use member function templates to accept “all compatible types”)
  条款46:需要类型转换时请为模板定义非成员函数(define non-member functions inside templates when type conversions are desired)
  条款47:请使用traits classes表现类型信息(Use traits classes for information about types)
  条款48:认识template元编程(Be aware of template metaprogramming)
8. 定制new和delete(Customizing new and delete)
  条款49:了解new-handler的行为(Understand the behavior of the new-handler)
  条款50:了解new和delete的合理替换时机(Understand when it makes sense to replace new and delete)
  条款51:编写new和delete时需固守常规(Adhere to convention when writing new and delete)
  条款52:写了placement new也要写placement delete(Write placement delete if you write placement new)
9. 杂项讨论(Miscellany)
  条款53:不要轻忽编译器的警告(Pay attention to compiler warnings)
  条款54:让自己熟悉包括tr1在内的标准程序库(Familiarize yourself with the standard library, including tr1)
  条款55:让自己熟悉boost(Familiarize yourself with boost)

《Effective C++(第三版)》 的55条建议的更多相关文章

  1. 《Effective Java 第三版》新条目介绍

    版权声明:本文为博主原创文章,可以随意转载,不过请加上原文链接. https://blog.csdn.net/u014717036/article/details/80588806前言 从去年的3月份 ...

  2. C++学习书籍推荐《Effective C++ 第三版》下载

    百度云及其他网盘下载地址:点我 编辑推荐 <Effective C++:改善程序与设计的55个具体做法(第3版)(中文版)(双色)>前两个版本抓住了全世界无数程序员的目光.原因十分明显:S ...

  3. Effective Java第三版(一) ——用静态工厂代替构造器

    此文做为<Effective Java>系列的第一篇,所以有必要大概说下此书的特点,当然很多人可能都看过,毕竟是有着Java四大名著之一的大名在外,不过总会有萌新不了解,例如我!<E ...

  4. 《Effective Java 第三版》目录汇总

    经过反复不断的拖延和坚持,所有条目已经翻译完成,供大家分享学习.时间有限,个别地方翻译得比较仓促,希望有疑虑的地方指出批评改正. 第一章简介 忽略 第二章 创建和销毁对象 1. 考虑使用静态工厂方法替 ...

  5. effective java(第三版)---读书笔记

    第一章 引言 < Effective Java>这本书并不厚,而且并不适合初学者,适合有一定的工作经验的java攻城狮.这本书不是百科全书式的JAVA 手册,而是试图在讲述如何正确.高效地 ...

  6. Effective Java 第三版——62. 当有其他更合适的类型时就不用字符串

    Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...

  7. Effective Java 第三版——55. 明智而审慎地返回Optional

    Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...

  8. Effective Java 第三版——11. 重写equals方法时同时也要重写hashcode方法

    Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...

  9. Effective Java 第三版——12. 始终重写 toString 方法

    Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...

随机推荐

  1. HDU 6214 Smallest Minimum Cut (最小割且边数最少)

    题意:给定上一个有向图,求 s - t 的最小割且边数最少. 析:设边的容量是w,边数为m,只要把每边打容量变成 w * (m+1) + 1,然后跑一个最大流,最大流%(m+1),就是答案. 代码如下 ...

  2. checkbox数据回显问题

    一.问题 在用复选框的时候,最常用的无非就是全选,全不选,数据回显等问题!要做的比较灵活!最近做项目的时候,就遇到这些问题,下面从js和JQueyr两方面解决一下全选,全不选,数据回显的问题. 二.H ...

  3. 20155318 2016-2017-2 《Java程序设计》第九学习总结

    20155318 2016-2017-2 <Java程序设计>第九学习总结 教材学习内容总结 学习目标 了解JDBC架构 掌握JDBC架构 掌握反射与ClassLoader 了解自定义泛型 ...

  4. Appium之打开应用时提示框处理

    当打开一个应用时,会有一个无关紧要的提示框,如果要继续操作,需要先关闭提示框,如下图(如新用户福利提示): 此时,如果你直接用Appium inspector或者Android uiautomator ...

  5. string 转换为枚举对应的值

    public static Object Parse(Type enumType,string value) 例如:(Colors)Enum.Parse(typeof(Colors), "R ...

  6. solr介绍一:Analyzer(分析器)、Tokenizer(分词器)

    首先,不知道大家在前面的例子中没有试着搜索文本串,就是在第二节,我们添加了很多文档.如果字段值是一个文本.你如果只搜索这个字段的某个单词,是不是发现搜不到? 这就是因为我们没有配置Analyzer,因 ...

  7. Python 爬虫入门实例(爬取小米应用商店的top应用apk)

    一,爬虫是什么? 爬虫就是获取网络上各种资源,数据的一种工具.具体的可以自行百度. 二,如何写简单爬虫 1,获取网页内容 可以通过 Python(3.x) 自带的 urllib,来实现网页内容的下载. ...

  8. JAVA环境下利用solrj二次开发SOlR搜索的环境部署常见错误

    问题一:出现控制台坏的响应错误一Bad request 控制台出现错误如下: Bad Request request: http://hostIP:8983/solr/update?wt=javabi ...

  9. [uwp]自定义图形裁切控件

    开始之前,先上一张美图.图中的花叫什么,我已经忘了,或者说从来就不知道,总之谓之曰“野花”.只记得花很美,很香,春夏时节,漫山遍野全是她.这大概是七八年前的记忆了,不过她依旧会很准时的在山上沐浴春光, ...

  10. Cookie背景了解

    Cookie的复数形态是Cookies, 英文的意思是小甜饼,小饼干. 类型为小型文本文件, 指某些网站为了辨别用户身份储存在用户本地中断上的数据. 是前网景公司的员工 卢-蒙特利在1993年3月发明 ...