COBOL case is an all‑uppercase naming convention with hyphens (-) between words, like COBOL-STYLE or USER-ACCOUNT. Born from the COBOL language, it still appears in config keys, URLs, and project names. This article explores its rules, use cases, and how it compares to other naming styles.
COBOL case is an identifier naming convention where every letter is uppercase and words are separated by hyphens (-). It comes from the COBOL programming language, where identifiers like data items and paragraph names could include hyphens and were traditionally written in all caps for readability. Classic examples: CUSTOMER-ADDRESS, TOTAL-AMOUNT. Though COBOL itself is less common today, this style persists in configuration files, URLs, and project branding because of its clarity and visual punch.
Every letter must be uppercase — this is the most distinctive trait. It resembles macro style (uppercase + underscores) but uses a different separator. The all‑caps look makes identifiers stand out, ideal for constants or important entities.
Words are joined by a single hyphen (-), e.g., ORDER-ITEM. Hyphens are legal in COBOL and also safe in URLs.
Identifiers must not start or end with a hyphen, nor contain consecutive hyphens (like USER--ACCOUNT), which could cause parsing ambiguity.
Numbers are allowed (e.g., VERSION-2), but usually not at the start. Acronyms like API or URL stay fully uppercase (API-KEY), matching macro style.
While COBOL isn't a daily language for most developers, COBOL case still finds practical use:
In COBOL code, data names, paragraph names, and file names typically use hyphens and all caps, e.g., EMPLOYEE-RECORD, CALCULATE-TAX. This is a long‑standing convention, and understanding it is essential when maintaining legacy systems or learning COBOL.
Some config files (e.g., .properties, YAML) allow hyphens in keys. COBOL case can be used for environment variables or system‑level settings, such as DB-CONNECTION-STRING. While lowercase or macro style are more common, COBOL case offers a bolder visual alternative.
In REST APIs or website paths, you sometimes see uppercase hyphenated segments to denote versions or resource groups, like /API/VERSION or /USER-PROFILE. This appears in branded URLs or internal systems.
Some projects adopt COBOL case for their names, e.g., MY-PROJECT, DATA-PIPELINE, to convey formality and high recognizability.
COBOL case and macro style (uppercase + underscores) are close relatives — both emphasize uppercase, just a different separator. Macro style is common in C/C++ preprocessor and constants, while COBOL case is rooted in COBOL tradition. Compared to kebab case (lowercase + hyphens), COBOL case gains extra visibility but loses low‑key elegance. Versus train case (capitalized + hyphens), it’s more forceful, fitting for constants or system‑level identifiers.
In practice, choose based on your project’s history and team guidelines. If you maintain a COBOL system or need to communicate with one, COBOL case is the natural fit. For modern web development, kebab or camel case are usually recommended.
USER-ID) for visual unity.COBOL (Common Business‑Oriented Language) was born in 1959 with a goal: make code readable by business folks. Its syntax leaned toward natural language and separators like hyphens for clarity. Early compilers were case‑insensitive, but programmers gravitated to uppercase for better legibility. That habit solidified into what we now call COBOL case. Although COBOL’s popularity has waned, its naming style lingers in finance, insurance, and other legacy‑heavy domains.
COBOL case is a classic, distinctive naming convention — all caps with hyphens. It holds lasting value in COBOL programming, configuration, and specific identification tasks. Understanding how it differs from macro, kebab, and train cases helps you pick the right style for the job. Whether you’re a COBOL veteran or just curious about naming schemes, learning COBOL case broadens your perspective.