Programming & AI:
Tips π‘
Articles π
AI & LLMs πΎ
Design, Architecture, Principles β
π³π± Contact: @MoienTajik
Post #137
823
JavaScript Clean Code π
Don't add unneeded context π‘
If your class/object name tells you something, don't repeat that in your variable name.
Bad :
Good :
ββββββ
#JSTips #CleanCode
@ProgrammingTip
Don't add unneeded context π‘
If your class/object name tells you something, don't repeat that in your variable name.
Bad :
const Car = {
carMake: 'Honda',
carModel: 'Accord',
carColor: 'Blue'
};
function paintCar(car) {
car.carColor = 'Red';
}Good :
const Car = {
make: 'Honda',
model: 'Accord',
color: 'Blue'
};
function paintCar(car) {
car.color = 'Red';
}ββββββ
#JSTips #CleanCode
@ProgrammingTip






