There are a number of name casing practices, which I’ll cover in quick fashion here, for variables and other objects when programming.
The Quickie Synopsis
With Camel Case the first letter of the first word is lower case, then every subsequent first letter of each word is upper cased. For example,
something if a singular word, or
In usage of Pascal Case, the first letter of each word within the name is upper cased. Examples include
Using Snake Case has the empty spaces replaced with underscores. So a file name like
this is my filename.md would become
My 2 ¢ – Snake case is great when I need to have variables that would otherwise have spaces, but also wouldn’t be displayed regularly with anything that might obfuscate the underscore, such as an HTML.
Kebabs are tasty, the case however is similar to Snake Case, except instead of underscores dashes are used. Each space in the name is replaced with a
- character. Such as
My 2 ¢ – Kebab case is excellent for filenames, URIs, or something of that sort where spacing between the words of a file or path are important to read, but an underscore would be obfuscated by the font rendering such as with a URI.
One thought on “Name Casing Conventions, The Quick Comparison”
Comments are closed.