10 April 2023

C++ 核心指南目录

“Use ALL_CAPS for all macro names”

理由

编码习俗。可读性。容易辨认出宏。

例子

#define forever for (;;)   /* very BAD */

#define FOREVER for (;;)   /* Still evil, but at least visible to humans */

强化

当你看到小写字母组成的宏时,请大声尖叫。