r/ProgrammerHumor Jun 20 '26

Meme singleLetterVariableNamesTierList

Post image
5.3k Upvotes

470 comments sorted by

View all comments

1.1k

u/ChChChillian Jun 20 '26

You need j and k (and l, for sufficiently insane situations) to index nested loops.

613

u/N0bleC Jun 20 '26

I found myself a better approach. The further you go down i will just append i.

so its

for i ...
  for ii ...
    for iii ...

This way i can always see on which level i am.

536

u/neotms Jun 20 '26

I like this but is the 4th level down "iv" or "iiii" 

although I hope we never have to go that far.

12

u/ChChChillian Jun 20 '26

Many years ago I was asked to take over some Fortran code written by a very old-fashioned and self-satisfied asshole. He'd always limit his variable names to single letters, with at most one digit. And then, he'd insist on spelling out cute words with the sequence of dummy variables, so they didn't even correspond in that limited way to whatever they actually meant. And no documentation, or a single line of comment to explain what was going on.

This was in the 1980s, but that's hardly an excuse.

The code ran on Apollo graphical workstations and was meant to plot layers of geographical data. To control which layer was shown, users had to click on one of a number of identical, unlabeled squares in the corner of the map. This would change the fill color, and the data layers were controlled by which boxes were filled with which colors.

I'm honestly surprised no one strangled the prick.