learning c++

C++ idiom
--especially for java programmer


一. Four program paradigms
Procedure, Object oriented , generic, stl .

二. Resource management
RAII , Resource acquisition is initialization


三. Also prefer abstract interface
But, Not all type need to be defined by pure abstract class.
A concrete type is the simplest kind of class ,Where applicable, prefer a concrete type over more complicated class.
Avoid fat interfaces;

四. Be suspicious of none const reference arguments
if you want the function to modify its arguments,use pointers and value return instead
五. Prefer none member function for operations that do not need access to the representation
Such as utility class .

六. Don't throw exception to outward module
Use error code to signal error.

七. Be familiar with stl methodology
Iterator :
The STL separates data structures and algorithms by using iterators as the interface .
In general, iterators do not know their containers.
sequence .
For_each
八. Strategy via function object
callable entity .function object .
std::tr1:function .
九. Be aware of difference between value from reference and (smart) pointer
十. Be cautious about introducing implicit conversions
十一. Be careful of overloading decision
十二. Be aware of None virtual Interface (NVI) pattern
十三. Be aware of template meta programming
十四. Prefer Multiple Header Files
十五. Don't assume that every exception is derived from class e x c e p t i o n


Reference :

《The C++ Programming Language》简称TCPL
《Effective C++ 3rd》 简称EC,C++程序员必读!如果我有权招聘程序员的话,没有读过这本C++"圣经"的人,大概...很多时候,我们说C++圣经不是指TCPL,而是这一本。
《C++ Coding Standards: 101 Rules, Guidelines, and Best Practices》简称《C++ 编程规范》,个人认为,这是C++程序员必备的案头书。

《Exceptional C++》和《More Exceptional C++》。新书《Exceptional C++ Style》也是值得一看的好书。


《The C++ Standard Library a tutorial and reference》听说过STL吗?这本书会教你最基本的,也是最重要的STL的使用。

《Generic Programming and the STL: Using and Extending the C++ Standard Template Library》,中文名称《泛型编程与STL》。这本书理论性较强,但是...但是真的很严谨,而且并不是非常难懂。理解其中对于Concept的解 释,将是非常重要的。

《Effective STL》会使用STL还不够,还必须知道什么时候选择什么STL组件,这是STL使用的必读书。

《morder c++ design : generic programming and design pattern 》。
《C++ Template》在阅读STL、Boost或者Loki的源代码之前,请仔细阅读本书,它可以减轻一些阅读的烦恼。这本书是谈论C++模版的权威

《more c++ idiom》 http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms

<comparison java and cpp>
http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值