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

前端 未结 15 1759
情歌与酒
情歌与酒 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条回答
  •  -上瘾入骨i
    2020-12-15 16:16

    With uppercase constants long formulas are much easier to read, you don't have to guess which element can vary and which can not. It's of course only a convention, but helpful one.

提交回复
热议问题