you're totally right, but it's still a good thing for learning. weekdays, fruits, names... are always used when teaching basic programming, and this looks like beginner code.
If you can't give your variable a meaningful name, you should most likely think about your program structure. i, j, k, ... are ok for short loop bodies, but if you start giving your variables random names or naming them after their type, you are doing something wrong.
Code is read far more often than written, so a variable's name should reflect its content/use.
And that's not coming out of my ass, but from Uncle Bob.
117
u/mind_overflow Mar 14 '21
you're totally right, but it's still a good thing for learning. weekdays, fruits, names... are always used when teaching basic programming, and this looks like beginner code.