📅 Posted 2015-05-12
Excuse the puns for the moment, but I have come across a number of cases of differing case for differing purposes in the case of software development.
This, therefore, is a case study of the true meaning of the term. Just in case you needed to know. So why not write about it.
We are all used to the typical UPPERCASE and lowercase cases which are commonly found in the English language. But what about other cases that are used in the software development field? I guess I knew all of these existed but didn’t really know the official term for them. Until now!
- snake_case - all lower case with underscores between each word
- camelCase - inital uppercase letter on all but the first letter and all spaces removed
- PascalCase - Camel Case with all inital letters uppercase, also known as UpperCamelCase or Dromedary Case
- WikiCase - Pascal Case but one-letter words are not accomodated
- Train-Case - initial uppercase letter with dashes between each word
- kebab-case - all lowercase with dashes between each word
- SCREAMING_CASE - all uppercase with underscores between each word
What this reminds me of is AS400 systems whereby the database was limited to 5 characters for naming fields so you had things like “CSBDT” which apparently could mean “Customer Birth Date”. I’m going to call this NNSCS… short for NONSENSE CASE.
Personally, I like kebab-case the most, because it’s easy to type (don’t need to use the shift key to access the dash or any of the letters) and it also works well in a lot of applications, such as file or folder names, URLs, JSON field names, etc. Where it falls down is in databases and most programming languages, which seem to think you are trying to deduct the word case from the word kebab. I also like the fact that it’s called kebab case. Yum!
So in the programming and SQL scenarios, I’m still undecided at this stage. Underscores look terribly old fashioned (in a bad way) and CamelCase is alright I guess but maybe not the easiest to read. Perhaps soon we won’t have to worry about SQL with all of the NoSQL movement. But that’s a topic for another blog. Perhaps we could use CamelCase for coding and snake_case for databases. Nothing like a bit of consistency, or lack thereof.
In any case, use those cases wisely!
Like this post? Subscribe to my RSS Feed or Buy me a coffee
Comments are closed