Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

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

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

Search from all Lessons


LoginGet Started
← Back to Lessons
  • coding standard guidelines

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 you can cause accidents and eventually you will get a ticket.

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.

  • 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 and all letters are lowercase. For example, "num_students" or "customer_address".
  • 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 for increasing code readability.