Don't add unneeded context

Don't add unneeded context

Tags
Clean Code
Javascript
Software Development
Published
Published May 30, 2022
Author
Due Date
☑️ Topic: Variables
 
☑️ Idea: If your class or object name tells you something, don't repeat that in your variable name.
 
☑️ Benefit: Readability. Code is easier to read if there is no unnecessary information bloating it.
 
☑️ Guideline: Shorter names are generally better than longer ones, so long as they are clear. Only add things if they provide real value to a name.
 
// BAD const Car = { carMake: "Honda", carModel: "Accord", carColor: "Blue" }; // GOOD const Car = { make: "Honda", model: "Accord", color: "Blue" };