Haruna
asked

Expert
Kelish Rai answered
I agree that all the names listed in the good and bad variable name examples are valid options for C++ programs.
However, when defining good variable names, the goal is to choose names that are both easy to understand and easy to work with.
For example, itâs much clearer to understand a variable named salary than one named s. Similarly, age is much easier to use and comprehend than something like aGekv2, which doesnât really convey any meaning.
In short, good variable names should be straightforward, intuitive, and consistent.
C++
This question was asked as part of the Learn C++ Basics course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer
