How to write clean code
-
We believe that #ifdef constructs are evil: (见:Avoid #ifdef)
We believe that #ifdef/#endif constructs are evil – an unavoidable evil, unfortunately.
-
If-Else: (见: 再写if-else罚款 )
If-Else 通常是一个糟糕的选择,它导致设计复杂,代码可读性差,并且可能导致重构困难。