您的位置:首页 > 编程语言 > C语言/C++

TIPS FOR C++

2007-03-28 19:16 375 查看
[1]Avoid type fields;
[2]Use pointers and references to avoid slicing;
[3]Use abstract classes to focus design on the provision of clean interfaces;
[4]Use abstract classes to minimize interfaces;
[5]Use abstract classes to keep implementation details out of interfaces;
[6]Use virtual functions to allow new implementations to be added without affecting user code;
[7]Use abstract classes to minimize recompliation of user code;
[8]Use abstract classes to allow alternative implementations;
[9]A class with a virtual function should have a virtual destructor;
[10]An abstract class typically doesn't need a constructor;
[11]Keep the representations of distinct concepts distinct;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++ 职场 休闲