Naming Conventions
A rule or standard for how variables are named in a programing language.
What are popular naming conventions in programming?
Each programming language has their own set of rules and standards for variable naming conventions.
Here are some of the common conventions that you will see. Being consistent in your naming style throughout your code is critical.
camelCase- first letter lower case - each new word upper case. This is the most common style in modern programming languagesPascalCase- the first letter of each word upper case - common for class names in many modern languages but also often used for function/method nameslowercase- all letter lower case - no spacessnake_case- all letters lower case - underscore for spaces - common for databases like PostgreSQL because table and column names do not support upper case lettersALL_CAPS- all letters UPPER CASE - under score for spaces - common for constant declarations in some programming languageskebab-case- all letters lower case - underscore for spaces - common in CSS for id and class naming standards_underscorePrefix- private variables are often prefixed with an underscore - it is less common in modern languages, but still in usestrHungarianNotation- prefix the variable with the type stored in the variable (old school) - this is uncomon in modern languages partly because in modern languages there are too many types to be able to prefix everything.
Level: Novice · More General terms at this level
Updated