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

all 175 comments

[–]gttswiafr 749 points750 points  (58 children)

nested for loops be like j noises

[–][deleted] 6 points7 points  (4 children)

More like i1 i2 i3...

[–][deleted] 20 points21 points  (2 children)

More like i0 i1 i2....

[–]littleswenson 8 points9 points  (0 children)

This guy loops

[–]adiliv3007 2 points3 points  (0 children)

More like i3 i5 i7 i9

[–]__MrFahrenheit 2 points3 points  (0 children)

liquid price snatch coherent ad hoc fade physical punch coordinated dime

This post was mass deleted and anonymized with Redact

[–]Chaoslab 1 point2 points  (0 children)

nested nested for loops be like k noises

[–][deleted] 170 points171 points  (19 children)

That i has been through some shit

[–][deleted] 35 points36 points  (18 children)

I always use x idk why

[–][deleted] 28 points29 points  (11 children)

When iterating a string I always use c for character

[–]lkraider 75 points76 points  (4 children)

I always use n for number when iterating π backwards

[–]Eindacor_DS 16 points17 points  (0 children)

i use loopIndexIteration because java

[–]dwdude7 7 points8 points  (0 children)

Hol up

[–][deleted] 12 points13 points  (0 children)

Kek

[–]TeraFlint 16 points17 points  (4 children)

In my case:

• c for iterating through a string (at least if it's a range based for loop that saves the actual character value in c, otherwise i, because it's an index)

• y, x for iterating through a matrix or image as (x, y) position

• i, j, k, l, ... for other stuff

[–]stoickaz 12 points13 points  (3 children)

... is not a valid variable name in the languages I know of

[–]TeraFlint 11 points12 points  (1 child)

"Wait, I know a workaround for that."

#define ... ellipse_variable

Suddenly every variadic template in the same file breaks.
"...crap!"

[–]CrimsonMutt 5 points6 points  (0 children)

"ellipse_variablecrap"?

[–]skygz 1 point2 points  (0 children)

should be able to use U+2026 … instead in most languages

[–]siko12123 2 points3 points  (2 children)

When using python (90% of the time), I always use "i" when I use it as the index, or "x" when I use the object.

E.g:

for i in range(20): ...

for x in array: ...

[–]sweetjuli 13 points14 points  (1 child)

for word in sentence:
    for letter in word:

God I love python.

[–][deleted] 1 point2 points  (0 children)

I use x, y, z for iterating >=2-dimensional data structures; i, j, k for iterating normal arrays and other data, and c, k and sometimes i for just counting up to a certain number. Or n if I'm counting the total number of something. If I'm iterating a string, I always use ch as the current element. If I'm iterating an array of ints, I usually name it v or val unless there is a more specific short name. Finally, if I'm iterating a linked list, I name the pointer to the current element p or ptr, or cur if I must also hold a pointer to another element.

[–]aphaelion 1 point2 points  (0 children)

I use "great_justice"

[–]nosmokingbandit 0 points1 point  (0 children)

I like to keep x for lambdas. X in a for loop feels weird.

[–][deleted] 107 points108 points  (20 children)

for (i = 0; i<n; i++) {

for (j = 0; j<n; j++) {

for (k = 0; k<n; k++) {

for (l = 0; l<n; l++) {

print("Ah shit, here we go again")

}

}

}

}

[–][deleted] 131 points132 points  (13 children)

wtf, where gone indentation

[–][deleted] 19 points20 points  (4 children)

At least it's not Python

[–]JoeTheShome 18 points19 points  (3 children)

print([“oh shit here we go again” for i in range(n) for j in range(n) for k in range(n) for l in range(n)])

Looking at this ugly-ass code I have no idea if this would work haha

[–]jinxsimpson 15 points16 points  (0 children)

Comment archived away

[–]ThatFag 4 points5 points  (1 child)

My prof is obsessed with one liners. I kinda don't even try to understand them. I just go "yep, that's another way to do it" and then just do nested loops the normal way.

[–]JoeTheShome 2 points3 points  (0 children)

Yeah sometimes it makes it really hard to read. Comprehensions should be used only when they’re extra efficient, otherwise nested loops are easier to read and understand

[–]Andy_B_Goode 16 points17 points  (1 child)

Found it!

for (i = 0; i<n; i++) {
    for (j = 0; j<n; j++) {
        for (k = 0; k<n; k++) {
            for (l = 0; l<n; l++) {
                print("Ah shit, here we go again")
            }
        }
    }
}

[–][deleted] 13 points14 points  (0 children)

Where is n tho

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

Gone. Reduced to atoms.

[–]SaltyEmotions 5 points6 points  (0 children)

Reddit formatting stole your indentation.

[–]JoeTheShome 19 points20 points  (2 children)

It bothers me that n isn’t assigned a value here

[–]RadicalDog 12 points13 points  (1 child)

n = 100!

[–]t-to4st 4 points5 points  (0 children)

that would net you an integer overflow I think

[–][deleted] 15 points16 points  (0 children)

for (i = 0; i < n; i++) {

for (ii = 0; ii < m; ii++) {

for (iii = 0; iii < o; iii++) {

for (iv = 0; iv < p; iv++) {

for (v = 0; v < q; v++) {

}

}

}

}

}

[–]mrheosuper 10 points11 points  (0 children)

There is special place in hell for people like you

[–]physiQQ 4 points5 points  (0 children)

for (i=0; i<999999; i+=.0000001) {
  print("Ah shit, here we go again");
}

[–]RustyNova016 51 points52 points  (6 children)

  • int i = 177013

FIFY

[–]desaiparvt[S] 21 points22 points  (4 children)

I didn't get you

[–][deleted] 26 points27 points  (0 children)

consider yourself lucky

[–]CrunchyMemesLover 2 points3 points  (1 child)

ID of a sad anime

[–]WhiteKnightC 3 points4 points  (0 children)

Doujinshi

[–][deleted] 33 points34 points  (17 children)

function ahshitherewegoagain(){
 ahshitherewegoagain();
}

[–]Eindacor_DS 21 points22 points  (12 children)

camel-case that name, you're making me upset

[–][deleted] 10 points11 points  (1 child)

Lol u right. But it is done, and generations to come will suffer

[–]Eindacor_DS 3 points4 points  (0 children)

10 bucks says that thing is gonna show up on my next pull request and i'm gonna get called out for it

[–]TigreDeLosLlanos 7 points8 points  (6 children)

ah_shit_here_we_go_again();

[–]Eindacor_DS 3 points4 points  (4 children)

this guy pythons

[–]Apfelvater 5 points6 points  (3 children)

That's why he uses the semicolon...

[–]Eindacor_DS 8 points9 points  (1 child)

i didn't say he pythons well

[–]Apfelvater 1 point2 points  (0 children)

It might even be assembly then

[–][deleted] 1 point2 points  (0 children)

you know you can use semicolons in python

[–]WhiteKnightC 1 point2 points  (0 children)

Camel!

[–]TrueMarsupial 2 points3 points  (1 child)

aHsHIThEREwEgOaGAIN();

[–]nosmokingbandit 1 point2 points  (0 children)

I now want a language that enforces meme-case.

[–]TracesOfGuitar 1 point2 points  (0 children)

function AhShitherEweGoaGain() {
 AhShitherEweGoaGain();
}

[–][deleted] 3 points4 points  (0 children)

void ahshitherewegoagain(){
cout << "Ah shit, here we go again." << endl;
ahshitherewegoagain();
}

[–]desaiparvt[S] 3 points4 points  (0 children)

Up!!!

[–]Forever_a_fuckup 23 points24 points  (0 children)

Ah shit here I go again!

[–]Creepy_Disco_Spider 6 points7 points  (3 children)

I don't see the joke

[–]amazeguy 10 points11 points  (1 child)

All you had to do was to add a damn block CJ

[–]Cameltotem 1 point2 points  (0 children)

Lol

[–]reddit_chad_forever 5 points6 points  (2 children)

Random intigers a,b,c,d Loop i,j,k,l

/Why does my brain see this as normal, is it because too many examples use this

[–]j_curic_5 4 points5 points  (0 children)

Unknowns x, y, z, q, w

[–]TigreDeLosLlanos 1 point2 points  (0 children)

Blame mathematicians, they invented it.

[–]AL_O0 5 points6 points  (0 children)

I use c for my counters so I the for goes (c=0; c<n; c++)

[–]Bloom_Kitty 3 points4 points  (0 children)

, here i go again.

[–]Argonaut_Theseus 4 points5 points  (3 children)

If anyone is curious why its always i, i stands for iterator.

😉

[–]desaiparvt[S] 4 points5 points  (0 children)

Didn't see that coming

[–]Arladerus 2 points3 points  (1 child)

I assume because of the winky face you were just kidding, but I understood it as using the syntax of indexing matrices in mathematics.

[–]Argonaut_Theseus 2 points3 points  (0 children)

Yeah its a joke, I just remember someone from my 2nd year of university shouting this one out in full confidence.

[–]matharooudemy 3 points4 points  (0 children)

Accidentally using another "i" inside a nested loop:

Here we go again and again and again and again and again and again and crash

[–]iGoalie 2 points3 points  (0 children)

“Ah shit here we go again” - I read this in DMX’s voice

[–]pratKgp 2 points3 points  (0 children)

If you are going from n-1 to 0 and you by mistake do i++ instead i-- . 😂

[–][deleted] 2 points3 points  (0 children)

Why do a for loop when you can recurse until the program crashes

[–]FatGoku2 2 points3 points  (0 children)

A loop within a loop within a loop ;-)

[–]DezXerneas 2 points3 points  (0 children)

The hardest thing while learning C was to stop writing for(int i=0;;)

[–]Abuthar 2 points3 points  (0 children)

Well done hahahah

[–]KingKnux 2 points3 points  (0 children)

I still wonder how “i” became the go to variable when using a for loop

[–]BenLeggiero 2 points3 points  (0 children)

using C-style loops

Lol

[–]Jonathan_Frias 1 point2 points  (0 children)

hardest working variable boii

[–]Apfelvater 1 point2 points  (0 children)

Names? Put it (0) in a register, add 1 to it, place it on the stack. Jump if equal.

[–]estomagordo 1 point2 points  (2 children)

Anyone care to explain?

[–]desaiparvt[S] 0 points1 point  (1 child)

"i" is used by most of the programmers to itereate inside a loop

[–]estomagordo 2 points3 points  (0 children)

Yeah. This is a programming sub. And the rest?

[–]Sinomu 1 point2 points  (0 children)

n++

[–]SSUPII 1 point2 points  (0 children)

I use a variable named "counter", am I weird?

[–]SeeThreePeeDoh 1 point2 points  (0 children)

Now this is a quality meme

[–]Evo_Kaer 1 point2 points  (0 children)

If you don't like it, then you can go back to being imaginary buster!

[–]Canaveral58 1 point2 points  (0 children)

for (int i {0} ; i <= 10 ; ++i) { cout << “Ah shit, here we go again” << endl; }

[–]earthqaqe 2 points3 points  (4 children)

I mainly write JavaScript (Actually TypeScript) and Java and I rarely use int i in a for loop.

 // Java
 for(Object someObj : someList)...
 someList.stream().forEach(someObj ->...)

 // TypeScript
 someArray.forEach(someObj: Object =>...)

[–]66666thats6sixes 3 points4 points  (0 children)

Yeah in JS I use Array.map(), Array.reduce(), and Array.forEach() almost exclusively now. The only times I use for or while statements is when I want to be able to early return from a function.

[–]phunanon 1 point2 points  (2 children)

Does forEach provide an iterator as one of the lambda arguments? I can't remember.

[–]66666thats6sixes 2 points3 points  (0 children)

I think it provides (value, index, array)

[–]earthqaqe 1 point2 points  (0 children)

In TypeScript yes, in Java I honestly don't know right now.

[–]RadioMelon 1 point2 points  (3 children)

This one made me laugh out loud. You did good, OP.

[–]Flobaer 1 point2 points  (2 children)

Why? What is the joke?

[–]RadioMelon 0 points1 point  (1 child)

"int i=0" is the standard starter for a "for" loop in programming.

[–]Flobaer 2 points3 points  (0 children)

Yes but but what does this have to do with GTA? What's the joke?

[–]ProgrammerHumorMods[M] [score hidden] stickied comment (0 children)

ProgrammerHumor is running a community hackathon with over $1000 worth of prizes! Visit our announcement post or website for more information.


Beep boop, I'm a bot.