16 January 2024

C++ 核心指南目录

“Don’t say in comments what can be clearly stated in code”

理由

编译器不读取注释。注释比代码精确度低。注释不一定跟代码保持一致。

坏例子

auto x = m * v1 + vv;   // multiply m with v1 and add the result to vv

强化

查看是否能在 C++ 中更好地表达