TIPS FOR C++

[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++,职场,休闲)