Before start just get a quick review about naming and the most used cases (in programming)
- lowerCamelCase
- CapitalCamelCase
- snake_case
- SCREAMING_SNAKE_CASE
- flatcase
- UPPERFLATCASE
Clarification: This list does not take in count the other variants such as kebab (screaming), train, http, etc, that are used for html, css or http because this article is oriented to programming and some cases for database naming.
This tips are just based on my personal experience and preferences. This article is oriented as a guide and does not pretend in any way being a standard of programming or any other thing
It does not really matter what is your preference when it comes to naming, however the only rule that may apply is constancy as long as you stay constant to a standard it is all about your taste
The most common cases
For the lowerCamelCase and the snake_case is great for variable/method naming For examplevar myInputNumber = 35; var some_other_input = 40; /* OR */ public int getMyInputNumber(){ return myInputNumber; } public int get_some_other_input(){ return some_other_input; }What about CapitalCamelCase, well that looks cool for classes
public class MyTestingClass{ /* do some stuff */ }So… where the SCREAMING_SNAKE_CASE went?, well I think it looks pretty cool for constants
public class MyTestingClass{ public static final int HOURS_OF_DAY = 24; }Show me something with flatcase and UPPERFLATCASE. True to be told, personally i never used the UPPERFLATCASE, so if you have some experience with it let me know the flatcase on the other hand, it comes handy for package naming (mostly in Java) but this depends on your company conventions too, so is not written in stone
package me.polarcoffe.testpackage; public class MyTestingClass{ public static final int HOURS_OF_DAY = 24; }