Programming Naming Convention : Camelcase, Snake_case Or Other
- Programming Naming Convention : Camelcase, Snake_case Or Other
these are some naming conventions to use when you are doing programming. , Last Updated: Sun Jul 05, 2020
Wed Oct 26, 2016
these are some of the naming i use when writing code:
camelCase - camel case is the most popular and widely use programming style recommended when you are writing code. why? simply because its very easy to distinguish each word on the variable which describes the variable itself.
Recommended Uses: variable names
CapitalizedWords - the only difference between this and camel case, is that you are capitalizing the first word, however, i do not recommend this method because you are wasting time by capitalizing the first word when its not necessary. when you are writing code, you want to be as efficient as possible, and with this method, you are putting an extra key strong by holding down the shift key.
Recommended Uses: file names, variable names
snake_case - here you are separating each word with an underscore. This method is the preferred method only when you are working with databases. for example, in MySQL when you are declaring database names, table names or fields
Recommended Uses: file names, url names, database names
hyphens-case - using hyphens or dash as they are often called is not advised,. never use this type of naming convention, you will find that many programming languages will generate errors, for example, i have gotten errors on PHP. Also, MySQL will not allow you to name tables in this format.
Recommended Uses: file names, url names