badlynamedvariable
nounUK /ˌbædliˈneɪmd ˈveəriəbl/
US /ˌbædliˈneɪmd ˈveriəbl/
A badly named variable is a name in a computer program that does not tell you what it holds.
The teacher pointed out that 'x2' is a badly named variable because nobody knows what it stores.
OTHER MEANINGS
2. A placeholder name that makes code harder to read and understand.
Using 'temp3' everywhere is a badly named variable that slows down debugging.
3. A name that breaks common coding style rules, like using single letters for important data.
Calling the user's age 'a' is a badly named variable in any style guide.
4. A label that misleads readers about what the stored value actually is.
Naming a list of students 'number' is a badly named variable because it holds names, not numbers.