CONSTANT_CASE
Constant case is the upper pattern with underscore _
delimiter.
Constant case is also known as upper snake case or screaming snake case.
History
Constant refers to a property of variables in programming languages. Constant variables never change value after being initialized. In the C programming language, the convention is to write these variables in what we refer to as constant case.
Languages such as Java refer to this type of immutable variable as final
but is cased the same.
Examples
Many programming languages, like Java or C, use constant case for constants: variables with unchanging value.
class Dog {
public static final int NUM_LEGS = 4;
}
const float PI = 3.14159;
C also uses constant case for macros, which are compile time evaluated blocks of code.
#define PI 3.14159
Rust uses constant case for global variables, both immutable (const
) and mutable (static
).
static SITE_NAME: &str = "stringcase.org";
const PI: f32 = 3.14159;