What Is SCREAMING_SNAKE_CASE? When to Use ALL CAPS with Underscores
3 min read
SCREAMING_SNAKE_CASE (also called CONSTANT_CASE or UPPER_SNAKE_CASE) uses all uppercase letters with underscores as separators: MAX_RETRY_COUNT, API_BASE_URL.
When to Use SCREAMING_SNAKE_CASE
- Constants: Values that never change at runtime —
MAX_CONNECTIONS = 100 - Environment variables:
DATABASE_URL,NODE_ENV,API_KEY - Enum values:
COLOR_RED,STATUS_ACTIVE(in C, Python) - Preprocessor macros:
#define MAX_BUFFER_SIZE 1024 - Global config:
DEFAULT_TIMEOUT,MAX_FILE_SIZE
Language Support
| Language | Used For | Example |
|---|---|---|
| Python | Module constants | MAX_RETRY = 3 |
| JavaScript | True constants | const API_URL = "..." |
| Java | static final fields | MAX_SIZE |
| Rust | const / static | MAX_THREADS |
| C / C++ | Macros, constants | BUFFER_SIZE |
Convert to SCREAMING_SNAKE_CASE
Use our constant case converter or case converter hub.