4Geeks logo
4Geeks logo
About us

Learning library

For all the self-taught geeks out there, here our content library with most of the learning materials we have produces throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Full-Stack Software Developer

Data Science and Machine Learning - 16 wks

Search from all Lessons

Social & live learning

The most efficient way to learn: Join a cohort with classmates just like you, live streams, impromptu coding sessions, live tutorials with real experts, and stay motivated.

← Back to Lessons

Continue learning for free about:

Edit on Github

Variable Naming Conventions

Do I really need to use naming conventions?

As you become a senior software developer, you understand better the importance of readability in your code. Variable naming conventions are -mostly- public standards and rules on how to name your variables when coding.

This article will explore the most popular naming conventions, when to use them, and why.

Do I really need to use naming conventions?

Absolutely yes!! Not using conventions when coding can be compared to not following the driving laws: You can drive your car without following them, but everyone will scream at you and think you are a jerk, and of course, you will receive a ticket eventually.

Software Developers that don't use naming conventions will become isolated from the coding community, and their code contributions will be ignored because the code is hard to understand. As a result, they will not be hired by most companies or will be fired when the company finds out.

The most crucial naming conventions

Most programming languages use one general convention for variable and function names and then other conventions for minor exceptions like class names, etc.

The two most popular general conventions are Snake Case for python and Came Case for Javascript and Node js. Pascal Case was used by Visual Basic, but now it's mainly used in most programming languages for classes and data structures.

  • CamelCase: In this convention, the first letter of each word except for the first word is capitalized. For example, "numStudents" or "customerAddress".
  • Snake case: In this convention, words are separated by underscores. For example, "num_students" or "customer_address". You can read more about the Snake Case naming convention here.
  • PascalCase: In this convention, the first letter of each word is capitalized. For example, "NumStudents" or "CustomerAddress".

Variable Naming Conventions are not the only thing that matters

Choosing clear, descriptive, and meaningful names for your variables and other elements in your code is essential regardless of which naming convention you use. This will help to make your code more readable and easier to understand.

There are only two hard things in Computer Science: cache invalidation and naming things. — Phil Karlton

We have dedicated a whole article about how to name your variables, as this is the most crucial skill to increase code readability.