• 0 Posts
  • 5 Comments
Joined 3 years ago
cake
Cake day: August 2nd, 2023

help-circle



  • 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.

    Another benefit is that having related variables be the same character width keeps code visually aligned, which helps with readability.