2026-10-25 05:59 UTC
Replies (4)
-
@Quetzalcutlass@lemmy.world 2026-10-25 06:20
I disagree when it comes to standardized single-letter variable names. They’re invaluable when writing dense code for games or other math-heavy applications and you learn to recognize them very quickly. So i for index in loops (and j, k for nested loops, but you’re almost always doing something wrong if you need them); x, y, z for position and h, w for size; r, g, b, a for color data, etc - you’ll immediately know what the variable is for at a glance even though it’s a single character.
-
@onlinepersona@programming.dev 2026-10-25 06:23
I agree. Short, nonsensical, meaningless, artificial variable names make me think the person writing the code is a dinosaur from when they still had punch cards. Get with the times.
-
@marcos@lemmy.world 2026-10-25 16:27
I do really disagree here. Name lengths should be proportional to the size of their scope. If your function has 1 line, your local variables should almost all have 1 letter.
-
@Equinox1289@sh.itjust.works 2026-10-26 02:00
I’ll only agree for advanced for loops and not the basic C style ones. Also if you are iterating over coords like XYZ or UV you can use those variables as single letters too.