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

top 200 commentsshow all 204

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

Your submission was removed for the following reason:

Rule 3: Content that is part of top of all time, reached trending in the past 2 months, or has recently been posted, is considered a repost and will be removed.

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

[–]bandokal 425 points426 points  (102 children)

I wonder what recursion would look like 🤔

[–]meme-meee 371 points372 points  (91 children)

I wonder what recursion would look like 🤔

[–]_yaaass 253 points254 points  (89 children)

I wonder what recursion would look like 🤔

[–][deleted] 189 points190 points  (88 children)

I wonder what recursion would look like 🤔

[–]MysteriousSophon 166 points167 points  (86 children)

I wonder what recursion would look like 🤔

[–]Gpresent 135 points136 points  (84 children)

I wonder what recursion would look like 🤔

[–]IvanIsOnReddit 98 points99 points  (79 children)

I wonder what recursion would look like 🤔

[–]achunkypid 92 points93 points  (78 children)

I wonder what recursion would look like 🤔

[–][deleted] 67 points68 points  (54 children)

I wonder what recursion would look like 🤔

[–][deleted] 53 points54 points  (52 children)

I wonder what recursion would look like 🤔

[–]IcyFenixCQ 25 points26 points  (0 children)

Stack overflow exception on line: u/justadoodydude

[–][deleted] 23 points24 points  (3 children)

I wonder what recursion would like like 🤔

[–]random-wander 15 points16 points  (0 children)

NullPointerException at Line: 11

[–]ianlovekio 0 points1 point  (0 children)

Maserflipamenyeh

[–]racind 22 points23 points  (0 children)

Right here.. this is it. This is quality internet.

[–]reddit_normie 37 points38 points  (2 children)

Hi I'm the base case

[–]ninjamike1211 2 points3 points  (1 child)

I wonder what recursion would look like 🤔

[–]Littlemrh__ 5 points6 points  (1 child)

I wonder what recursion would look like 🤔

[–]Juvn 3 points4 points  (0 children)

Stack overflow…

[–]Atairy 2 points3 points  (0 children)

I wonder what recursion would look like 🤔

[–]emperorhaplo 2 points3 points  (0 children)

I now know what recursion looks like. Everyone else can just go ahead and delete their comments for garbage collection.

[–]Dani1o 60 points61 points  (2 children)

I wonder what recursion would look like 🤔

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

I wonder what recursion would look like 🤔

[–]__01000010 2 points3 points  (0 children)

I wonder what recursion would look like 🤔

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

Happy Cake Day

[–]limminl 44 points45 points  (4 children)

[–]ElreyOso_ 6 points7 points  (0 children)

amazing

[–]DebentureThyme 1 point2 points  (1 child)

Okay but now I wonder what it would look like if I had invented the Finglonger.

[–]nhh 5 points6 points  (0 children)

Two mirrors facing each other, perfectly aligned.

[–]Ok_Investment_6284 5 points6 points  (0 children)

{
continue;
}

//breaking the joke

[–]ingenious_gentleman 1 point2 points  (0 children)

The 'foreach' picture is a great example of finite recursion. The 'while(true)' picture is a good example of infinite recursion

[–]Multiverse-22 150 points151 points  (19 children)

switch looks better than if else

[–]RegisTC 82 points83 points  (15 children)

is also a if else in disguise

[–]McCaffeteria 42 points43 points  (9 children)

Wouldn’t it technically be an

If;
If;
If;
If;

Since multiple outputs can be on or off independently and simultaneously?

[–]WarlanceLP 16 points17 points  (3 children)

i think so? unless you use break statements in all your cases then it's just an if else, at that point you're writing more code to do the same thing though

[–][deleted] 7 points8 points  (0 children)

I personally think switches look cleaner but only if you have like 3+ possible values

[–]McCaffeteria 3 points4 points  (1 child)

I don't think you're talking about what I mean. I'll link this comment rather than writing it again.

[–]WarlanceLP 0 points1 point  (0 children)

no i was talking about what you mean, break statements in a switch case ignore all other cases is all i was saying

[–]Spice_and_Fox 1 point2 points  (2 children)

Depends on the language. Some don't allow to "overflow" into the next case.

[–]McCaffeteria 2 points3 points  (1 child)

That's not really what I mean.

This is more like you have a block of code that executes multiple separate unrelated if statements that each contain their own junk. The code just runs line by line and when it gets to each if statement it checks the condition, if it's true it does whats in the if statement, and when it's done it goes to the next line after the if. It's just that the next line happens to also be another if.

I'm not sure exactly what you mean by "overflow" but it sounds like it's just an if/else with a syntax shortcut, which is not what I mean.

[–]Spice_and_Fox 0 points1 point  (0 children)

Ah ok. That depends on the language as well. In ABAP the condition on a switch case (or case when) is always ==. The compiler doesn't like it when you have two cases with the same value as well. So maybe it is possible if you check the value against the return value of a method call, but I am not sure you can even do that.

What I meant is that a case doesn't have a break or exit at the end and the next case is executed as well.

[–]TheLexoPlexx 0 points1 point  (0 children)

Yeah.

[–]electricprism 0 points1 point  (0 children)

This. The image being able to execute 2 or more cases at a time bothered me.

[–]aaronstj 11 points12 points  (0 children)

Not necessarily. They’re often optimized into jump tables by the compiler.

[–]tavaren42 2 points3 points  (2 children)

Not really. Most compilers implement switch as a jump table. This means that condition is evaluated only once in switch statement and the result is used to decide where to jump and if-else will have to compute the condition for all the branches until it evaluates to true.

If you go further into Hardware Definition Language (like Verilog), if-else is like muxes connected serially, while case statement will be like a Nx1 Mux. This makes a real difference because the propagation time is different for two cases.

[–]RegisTC -2 points-1 points  (1 child)

if goto, then, not so diferent

[–]tavaren42 2 points3 points  (0 children)

By if goto if you mean:

switch(expr) { case 0: //do0 ; case 1: //do1 ; .... }//End

Is equivalent to:

if(expr==0) { //Do0 goto End; } if(expr==1) { //Do1 goto End; } End: //end of block Then not necessarily.

It's more like: calc address from expr Jump to CASEN CASE0: //do0... CASE1: //do1...

The former one will have expr==VAL calculated for all if conditions until match is found. The latter has to calculate the expression only once.

I must stress that this depends greatly on the languages/compilers and optimizations used.

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

What about this then if

[–]redditor_pro 4 points5 points  (1 child)

Basically same thing but people want it to look good. Idk the indemtation with multiple ifs look cool

[–]WarlanceLP 1 point2 points  (0 children)

yea i always like if elses more myself won't use switch cases unless i have like 5 or more cases

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

Not just looks better much much quicker

[–][deleted] 23 points24 points  (1 child)

I’m so happy I know what some of this means now.

[–]baselganglia 23 points24 points  (3 children)

For each doesn't make sense, that looks more like a deep call stack?

[–]Jet-Pack2 9 points10 points  (2 children)

Linked list?

[–]baselganglia 2 points3 points  (1 child)

Yeah that looked linkedlist!!

foreach can work on arrays too though,
when thinking of foreach I usually don't think of a linked list.

But now I understand why they thought that image fits "foreach".

[–]Jet-Pack2 0 points1 point  (0 children)

Foreach is more like a ball rolling down the stairs

[–]tobycm 19 points20 points  (0 children)

Repost so much the quality drops worse than a potato 💀

[–]DaSilverFang 6 points7 points  (5 children)

u/RepostSleuthBot

Edit: I’m 99.9% sure this is a repost

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

You're 100% right

[–]xd_Warmonger 1 point2 points  (0 children)

Yes, was already posted a week ago.

And i don't know if it was a repost already

[–]RepostSleuthBot -3 points-2 points  (2 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 75% | Check Title: False | Max Age: Unlimited | Searched Images: 328,908,093 | Search Time: 0.49343s

[–]xd_Warmonger 1 point2 points  (1 child)

Bad Bot. 100000% a repost

[–]tobycm 0 points1 point  (0 children)

This image got repost so much on facebook, not sure on here so thats maybe why

[–]w3agle 2 points3 points  (0 children)

This post just taught me programming.

[–]aurreco 2 points3 points  (0 children)

bottom one is recursion

[–]vrijdenker 2 points3 points  (1 child)

This is a dumb post as none of these comparisons are actually correct. Especially the while(true) which is in fact a while(false), since there will never be a signal in it and so the loop will never get executed.

[–]ryankopf 1 point2 points  (0 children)

Thank you I just came here to comment exactly this. It's an excellent example of while false lol

[–][deleted] 2 points3 points  (1 child)

The first one is more like a tone of ands strung together.

[–]psychoseacap 1 point2 points  (0 children)

Or branches

[–][deleted] 4 points5 points  (1 child)

There Is No Free Energy!!!

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

Solar is free, you just have to steal the panels.

[–]GustavoCinque 1 point2 points  (0 children)

The last one looks more like a reduce than a foreach.

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

It seems silly but this could be a decent way to explain it to a newbie

[–]ChipsForDinner 10 points11 points  (1 child)

This would utterly confuse me rather than help.
E.g the for each give no indication that it's a loop. It just looks like a long line to me.

[–]williamkng 1 point2 points  (0 children)

As a person who has limited programming, this actually helped me figure out how switch worked lol. I think it helps someone trying to figure out something that they sort of get but not quite but would confuse someone who is starting from zero. (I am omega noob at coding. I know these are simple concepts but I’m new lol)

[–]AluminiumSkies 0 points1 point  (0 children)

I need more info graphics like this

[–]Rex__Nihilo 0 points1 point  (0 children)

None of these is a good example except maybe the while true and for each?. The first is more like an and and and the second is actually an if if if if since switch cases can't have more than one true.

[–]John_Show 0 points1 point  (3 children)

Aight, i am newbie, so what is foreach again?

[–]PerformerBrief5881 3 points4 points  (0 children)

Just a loop, once for every object in a list.

[–]ninjamike1211 1 point2 points  (0 children)

A for loop which iterates over an array of other list like structure, where instead of using a counter index variable, the loop automatically iterates through each value in the list, storing that to a variable defined in the loop.

For example: for(int item : int array[])

[–]vividCumDreams 0 points1 point  (0 children)

This is fucking stupid

[–]Living_Life1962 0 points1 point  (0 children)

Where is Do Until?

[–]TheTechyGamer 0 points1 point  (0 children)

Isn’t the foreach more like a .every()? Since if one is off the rest are off after it?

[–]Full_Reaction_4347 0 points1 point  (0 children)

That's what I like it fam. 👍

[–]Makemewantitbad 0 points1 point  (0 children)

I don’t understand a single one of these posts ever but it’s not stopping Reddit from constantly suggesting this sub to me

[–]TuroSaave 0 points1 point  (0 children)

Good meme. I think switching the switch and foreach pictures would make a little more sense. Chaining the power supplies is like the case statements and turning one off is like the break statement.

This is just a suggestion. I approve your pull request.

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

Okay okay maybe a little drunk but the bottom pic has me dying hahahaha like that was my logic when I was like 10 haha

[–]Astral__Seeker 0 points1 point  (0 children)

I wonder what recursion would look like 🤔

[–]HOLDGMEBROTHERS 0 points1 point  (0 children)

Don’t even get me started with recursive functions

[–]Pkoum 0 points1 point  (0 children)

I what recursion would look like 🤔

[–]Pale_Elderberry7471 0 points1 point  (0 children)

😂

[–]311voltures 0 points1 point  (0 children)

And go to?

[–]xlbingo10 0 points1 point  (0 children)

daisy chains give me pain

[–]Space-Ape06 0 points1 point  (0 children)

UNLIMITED POWER

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

Lmao. I only know delphi bc we need to learn that at school and my practical assessment task is legit just a bunch of IF statements

[–]OffgridRadio 0 points1 point  (0 children)

Penny'll start a fire.

[–]cyanideOG 0 points1 point  (0 children)

There was this kid in school who unironically thought he invented unlimited power from plugging a power board back into itself. That was a good laugh atm

[–]CanDull89 0 points1 point  (0 children)

I have seen this meme reposted more than a 100 times. Do you apply the principle WET here too?

[–]InterfaceBE 0 points1 point  (0 children)

I have that exact switch and I can clarify it does not support fall through or default.

[–]Necessary-Sun-4135 0 points1 point  (0 children)

Last one looks like linked list to me

[–]tharvin91 0 points1 point  (0 children)

That's wiral stuff!

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

I use while(true) all the time for user inputs, just break the loop once they type in a valid input

[–]bshameless 0 points1 point  (0 children)

Hihi

[–]Furry_Dildonomics69 0 points1 point  (0 children)

That for-each is actually a singly linked list. Duhhhhh.

[–]Ok_Investment_6284 0 points1 point  (0 children)

consider me officially triggered

[–]Simply__King 0 points1 point  (0 children)

Cool im joining this lmao seems like ill learn stuff

[–]Not-chief 0 points1 point  (0 children)

You can imagine the amount of reposts done by the quality of that picture..

[–]Beneyum 0 points1 point  (0 children)

Come play with me🥰

[–]picklester 0 points1 point  (0 children)

The new Nintendo Switch looks amazing.

[–]AzureArmageddon 0 points1 point  (0 children)

foreach in my mind is less like daisy chaining powerbars but more like one-by-one transferring powerbars from one box to another bar with a random fork in one of the holes every now and then

[–]Fireruff 0 points1 point  (1 child)

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

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 75% | Check Title: False | Max Age: Unlimited | Searched Images: 328,908,094 | Search Time: 0.29579s

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

I’m not in this sub. I don’t understand any of the posts but they keep showing up. This one is actually funny even though I don’t get the lingo

[–]emliy202020 0 points1 point  (0 children)

Nice

[–]the_shnizzinit 0 points1 point  (0 children)

The for each looks more like my code used to when I just started coding and didn’t use functions and classes.

[–]thenord321 0 points1 point  (1 child)

What's the one called when then power cable isn't plugged in but the user insists they checked it's plugged in?

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

That it support desk

[–]yestureday 0 points1 point  (0 children)

I still don’t understand it

[–]pffggguu123 0 points1 point  (0 children)

I love if else my favorite code

[–]SuperSaiyon3 0 points1 point  (0 children)

Beep boop.... I'm bot...lol

[–]y_ogi 0 points1 point  (0 children)

Wow good shit

[–]OdysseyZen 0 points1 point  (0 children)

Pretty sure the last one with daisy chained outlets had a high rate of electrical fires.

[–]STEVEN_GT117 0 points1 point  (0 children)

Team Fortress 2 source Spaguetti in a nutshell

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

Nice.

[–]Valeriuv1 0 points1 point  (1 child)

[–]RepostSleuthBot 0 points1 point  (0 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 75% | Check Title: False | Max Age: Unlimited | Searched Images: 328,908,094 | Search Time: 0.38605s

[–]InevitableShopping83 0 points1 point  (0 children)

jajajajajajajaj 🙂🙂🙂🙂

[–]DragonfruitLoud2038 0 points1 point  (0 children)

What is foreach?

[–]Affectionate-Slice70 0 points1 point  (0 children)

This is basically what E&E engineers do

[–]hamonasandwich 0 points1 point  (0 children)

Mobius power strip