Naming: Why should named constants be all uppercase in C++/Java?

前端 未结 15 1765
情歌与酒
情歌与酒 2020-12-15 16:13

I know, that for C++ and Java it is a well established naming convention, that constants should be written all uppercase, with underscores to separate words. Like this (Java

15条回答
  •  隐瞒了意图╮
    2020-12-15 16:25

    Do not use ALL_CAPS for constants just because constants used to be macros.

    This quote from C++ Core Guidelines sums it all.

提交回复
热议问题