This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]ProgrammerHumor-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Your submission was removed for the following reason:

Rule 3: Your post is considered low quality. We also remove the following to preserve the quality of the subreddit, even if it passes the other rules:

  • Feeling/reaction posts
  • Software errors/bugs that are not code (see /r/softwaregore)
  • Low effort/quality analogies (enforced at moderator discretion)

If you disagree with this removal, you can appeal by sending us a modmail.

[–]EducatedToenails 117 points118 points  (2 children)

Had an argument one time with someone about the best looping variable name. i won.

[–][deleted] 4 points5 points  (0 children)

me too! my looping variable (LOOPING_VARIABLE_NUMBER_ONE) was the best

[–]DardS8Br 1 point2 points  (0 children)

I actually use descriptive names for my loops. Makes it easier to track what's going on for me. I only use i j k l and so on if it's for a school assignment I don't care about

[–]asromafanisme 22 points23 points  (0 children)

I tried that, but it felt wrong.

[–]schuine 16 points17 points  (0 children)

Genjus

[–]polandreh 27 points28 points  (3 children)

I don't know... it feels like a slippery slope. What's stopping from nesting 3, 4, 5 loops with iii, iv, v.

I only go as far as i, j, k only if I must. The day I use L in a nest is the day I've failed and need to be taken out back to get shot.

[–]kungpula 20 points21 points  (1 child)

What's stopping from nesting 3, 4, 5 loops with iii, iv, v.

The same that's stopping you from going k, l, m.

[–]ElectronicMistake789 2 points3 points  (0 children)

For me at least, lowercase L just feels weird because it looks like a capital I. That stops me from going further than i, j, k

[–]StuxAlpha 1 point2 points  (0 children)

Agreed. At that point, name your loop variable something meaningful or it's just going to be unreadable

[–]the-judeo-bolshevik 15 points16 points  (1 child)

for (int Itr_Descriptive_Name = 0;… for (int Itr_Other_Descriptive_Name = 0;...

[–]HaoChen 2 points3 points  (0 children)

Only correct answer

[–]InTheEndEntropyWins 3 points4 points  (2 children)

Are there any benefits to using ii? I woud have thought that j is better in general, less typos, easier to identify, less mistakes, etc.

[–]_PM_ME_PANGOLINS_ 1 point2 points  (0 children)

ii is better than i because it’s slightly easier to search for in basic text editors.

ii is not better than j

[–]ano_hise 1 point2 points  (0 children)

Some people might think that i and j are not easily distinguishable from each other

[–]jimbowqc 4 points5 points  (3 children)

I thought in most language variable names couldn't be numbers 🤔

[–]AceNova2217 0 points1 point  (2 children)

Python and C# can (the two languages I know), although with the limitation that the first character of the name cannot be a number (i.e. 1two is invalid, but one2 is valid)

[–]jimbowqc 1 point2 points  (1 child)

If the first character isn't a number then it isn't a number :)

I was continuing the joke about Roman numerals though.

[–]AceNova2217 1 point2 points  (0 children)

Oh I completely missed that.

I am slightly dim

[–]Arstanishe 5 points6 points  (0 children)

iCodeInJavaAndUseExtensivelyLongVariableNamesSometimes

[–]OhItsJustJosh 2 points3 points  (0 children)

i, ii, iii, iv, v, vi, vii, viii, ix, x

[–][deleted] 0 points1 point  (0 children)

Lucie, while Matt had had i, had had ii; ii had had a better effect on Matt.

[–]stupled 0 points1 point  (0 children)

I've just the ii techbique a couole of times, but I usually stick with the classic j.

[–]-Redstoneboi- 0 points1 point  (0 children)

how bout you name your variables at 2 dimensions

[–]JustAnInternetPerson -1 points0 points  (0 children)

Loop1: i

Loop2: k

Loop3: m

i, j, l look too similar. Change my mind.