In this Article
Why learn case types for programming language?
Naming things when working with computers and particularly in programming is inevitable.
Its important to learn the correct specifications of programming languages to avoid applying incorrect naming conventions which may lead to all sorts of weird errors.
To enable you to easily name things, you must know the case types you want to use so that you can have a consistent naming convention for each of your software project. When learning about or writing software in Python and JavaScript, you will be required to use certain case types.
Common case types with examples.
- Camel case - PNG example, camelCase (camels back with a mount for each first letter of the next word)
Starts with a lowercase letter and the first letter of every new following word has its first letter capitalized and is connected with the starting word.
An example of camel case of the variable camel case var is camelCaseVar
- Snake Case - PNG example, snake_case (under score to connect the words like the belly of a snake)
A snake_case replaces all spaces with an underscore character(_) and low casing all the words.
An example of snake case of the variable snake case var is snake_case_var.
- Kebab Case - PNG example, kebab-case (connected like ‘stick’ meat, with a dash)
kebab-case is as simple as replacing all spaces with a "-" and lowercasing all the words. It's possible to kebab-case and mix camelCase and PascalCase but that ultimately defeats the purpose.
An example of kebab case of the variable kebab case var is kebab-case-var.
-
Pascal Case - PNG example, PascalCase ( First letters for each to words compounded together are capitalized)
-
Upper Case (with Snake Case) – PNG example, UPPER_CASE_SNAKE_CASE ( upper case letters with snake case)
Replace all the spaces with an underscore (_) and converting all the letters to uppercase.
An example of upper case snake case of the variable upper case snake case var is UPPER_CASE_SNAKE_CASE_VAR.
Naming Case types for JavaScript
-
Camel case for variables and methods.
-
Pascal case for types and classes in JavaScript.
-
Upper case snake case for constants.
Each JavaScript framework may further require unique conventions. In React JavaScript framework, Pascal Case is used for naming components and files.
Naming conventions for Python
-
Snake case for method names and instance variables (PEP8).
-
Upper case snake case for constants.
This is an introduction to the most commonly used case types used in programming, and the case types for Python & JavaScript. Hope you learn more to apply the appropriate case types in your favorite programming language.

GlenH - Nov 29, 2023gghayoge at gmail.com