When coding, text cases become an important factor if you want to maintain your code up to a high standard, following best practices. Different languages follow different naming conventions for variables, constants etc. Here we discuss some of the different types of text casing and their usages in some popular languages.
Spaces are omitted and first letter of each word is capitalized. Looks like a camel with many humps. Other names: Pascal Case, Bumpy Caps, Upper Camel Case.
XmlHttpRequest (Note how popular abbreviations are converted.)
C#/VB (VB is case insensitive) method names
Headless Camel Case
Spaces are omitted and first letter of each word except the first word is capitalized. As implied by the name, looks like a camel without its head.
Java method and variable names
Looks like snakes, with the words of phrases are separated with undescores (
_) rather than spaces.
Python/Ruby function and variable names
Screaming Snake Case
Screaming most of the time means making all the text uppercase. This case is the same as snake case except that all letters are capitalized.
In most programming languages, constants are named using screaming snake case.
Kebab Case / Lisp Case
This one does not have a standard name but called with names like Caterpillar Case, Spine Case, or Hyphenated.
This one is the same as the above, but first letters of all words are capitalized.
Looks more like a screaming Lisp case. Hyphenated words with all caps.
Uppercase letters and lowercase letters are mixed. I’m curious whether this is used in any kind of programming.
If you know of more, or if you want to add anything, need clarifications, please comment below. :smile: