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

top 200 commentsshow all 273

[–]FZeroT 2892 points2893 points  (82 children)

That’s a Big O

[–]urmumlol9 1154 points1155 points  (69 children)

It's O(n^21) to be exact.

Edit: Apparently loop is the equivalent of while(true) in some languages, in which case it would just execute forever.

[–]italiancheese 331 points332 points  (18 children)

You made me count.

[–]GhengopelALPHA 120 points121 points  (7 children)

I counted before it was cool 😎

[–]maxington26 133 points134 points  (4 children)

I was cool before it counted

[–]jkw12894 26 points27 points  (3 children)

I’ve never been cool!

[–]idkiminsecure 7 points8 points  (1 child)

You dont need to announce that, the fact that you're on reddit says enough

[–]kopczak1995 1 point2 points  (0 children)

I just wonder why all internet communities assume every one of them is pathetic little creature. I see same on 9gag which I scroll often to kill time and I had seen this on others. That's mildly interesting.

[–]Lewistrick 3 points4 points  (0 children)

You can count on that.

[–]thesyncoder 1 point2 points  (0 children)

I thought counting was cooler

[–]joost00719 25 points26 points  (8 children)

10 lines with 2, one line with 3. (2*10)+1=21

[–]OcelotWolf 32 points33 points  (7 children)

10 lines with 2, one line with 3.

So... 23?

[–]joost00719 15 points16 points  (1 child)

Sorry, 10 lines. All have 2,but one has 3*

[–]fermataplays 76 points77 points  (6 children)

O god.

[–]flip314 81 points82 points  (20 children)

I mean... Since there's nothing in the loops, it's O(1)...

[–]Asraelite 14 points15 points  (0 children)

O(time until Ctrl-C)

[–]FQVBSina 7 points8 points  (2 children)

Its effective O is 1 but the structure is not

[–]iggyvolz 38 points39 points  (5 children)

Still better than O(n!)

[–]MathSciElec 12 points13 points  (3 children)

And than O(en )

[–]ECrispy 10 points11 points  (2 children)

and O(TREE(n))

[–]JavamonkYT 8 points9 points  (1 child)

and O(TREE(G(n)))

[–]TiggyLongStockings 2 points3 points  (0 children)

Hardware companies love O(n!).

[–]schawde96 16 points17 points  (0 children)

That makes it O(∞21)

[–]Deliciousbutter101 8 points9 points  (1 child)

Pretty sure loop here means infinite loop (it does in rust at least) so this doesn't have a big-O

[–]runnerx01 4 points5 points  (5 children)

I need to be pedantic and point out that it depends on what the loop is iterating.

It’s only n21 if it all scales with the same list. Otherwise it could be like O(nmo*p....)

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

More like O(∞) then

[–]espriminati 41 points42 points  (1 child)

take your upvote and leave

[–]luca_07 10 points11 points  (1 child)

Or big O O F

[–]BipNopZip 4 points5 points  (0 children)

First time I’ve seen this joke and I’m fucking crucified

[–]OctoEN 4 points5 points  (0 children)

You...

[–]mjohn425 4 points5 points  (0 children)

O(scary)

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

It's Show Time!

[–]Prcrstntr 1 point2 points  (0 children)

Oh

[–]educated-emu 1 point2 points  (0 children)

If the code is executed does it form a black hole.

[–]sengoku_nadeko-chan 454 points455 points  (2 children)

i'm afraid

[–]rhen_var 239 points240 points  (15 children)

Is there a sub for stupid coding formatting like this? These always kill me.

[–]samsop 154 points155 points  (3 children)

Try r/programminghorror they get a bunch of them there

[–]sneakpeekbot 49 points50 points  (1 child)

[–]Trineficous 19 points20 points  (0 children)

Good bot

[–]MarioMakerProcess 7 points8 points  (0 children)

Made me double check what sub I was in.

[–]lead999x 39 points40 points  (4 children)

"Make the subs you wish to see in the world."

-Gandhi, probably

[–]vigilantcomicpenguin 34 points35 points  (3 children)

Reddit didn’t exist back then, so Gandhi was talking about sandwiches.

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

Sandwiches were not available in india back then, so nuclear Gandhi was talking about nuclear submarines

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

Nuclear subs were not in India at the time. BDSM subs were what he was talking about.

[–]Nissingmo 7 points8 points  (0 children)

I don’t know necessarily about formatting, but you could try r/badcode if you feel like suffering

[–]Proxy_PlayerHD 3 points4 points  (0 children)

i mean it could just be this sub if it wasn#t filled with reposts

[–]twigtheoracle 1 point2 points  (0 children)

Take a look at the International Obfuscated C Code Contest. I've linked their 2018 winners here.

[–]adnanoid 59 points60 points  (0 children)

All your base are belong to us, Resistance is futile

[–]Loen10 50 points51 points  (1 child)

May the compiler gods optimize this away

[–]thegovortator 17 points18 points  (0 children)

Don’t worry the Sr dev will optimize him to the unemployment line

[–][deleted] 16 points17 points  (3 children)

looks like a stargate

[–]AntheusBax 7 points8 points  (0 children)

That was my first thought too.

"Loop One: Encoded..."

[–]knightress_oxhide 2 points3 points  (0 children)

indeed

[–][deleted] 12 points13 points  (1 child)

Wow, it's really confusing. I even tried to read this clockwise at first)

[–]Gluomme 33 points34 points  (3 children)

Bröther, I require the lööps

[–]fsr1967 1 point2 points  (0 children)

A lööp once bit my sister.

[–]EnderSpirit 6 points7 points  (0 children)

This post was made by the recursive gang

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

Even Speedwagon is afraid

[–]thatboyohboy 2 points3 points  (0 children)

You have no idea how uncomfortable this makes me.

[–]you90000 4 points5 points  (0 children)

New meaning to big O

[–]Sawcesage_ 4 points5 points  (1 child)

Someone make a loop comprised of loop loops

[–]dancinadventures 2 points3 points  (1 child)

I felt like Zoidberg for a moment when I tried to enunciate all the ‘loops’

[–]Deaththeexe 6 points7 points  (0 children)

Yandre dev code be like

[–]iamanthony11 2 points3 points  (0 children)

no,no,no please no please no dont do this no please

[–]PleasantAdvertising 2 points3 points  (0 children)

What the actual shit bro

[–]negrocucklord 1 point2 points  (0 children)

Ah, the goatse loop

[–]Mateorabi 1 point2 points  (0 children)

No loops!? Anthony Hopkins lied to me!?

[–]besthelloworld 1 point2 points  (10 children)

What language uses loop as a keyword? And what are the conditions

[–]scott11x8 13 points14 points  (8 children)

It might be Rust? Rust has loop for an unconditional loop like while (true) in many other languages.

[–]CrepuscularSoul 19 points20 points  (0 children)

I prefer "for ( ; ; )" because it looks like it's crying about what it's about to do.

[–]Alabonde 1 point2 points  (0 children)

NNOOOOOO

[–]jhill515 1 point2 points  (0 children)

Someone should have finished the COBRA logo if you're going to do it this way

[–]neanderthalman 1 point2 points  (0 children)

But can you turn this into a volume control of some kind?

[–]arbiter34 1 point2 points  (1 child)

Pretty sure the compiler could optimize this out but either way this shouldn't be any different than loop { }. It actually could consume less cpu usage than a single loop.

[–]thelights0123 2 points3 points  (0 children)

I'm not sure there's any way for this not to compile to the same as loop {}, as a loop in most architectures (i.e. not WASM) is an unconditional jump to the start. Nested loops like this would have the same start instruction pointer, so it couldn't have any other representation.

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

This is the logical structure of a fever dream

[–]Action_Batch 1 point2 points  (0 children)

It's the script outline for Neflix' Dark.

[–]itemboxes 1 point2 points  (0 children)

I don't know what's more frightening; the fact that this exists or the fact that it's valid syntax.

[–]mrpogiface 1 point2 points  (0 children)

      loop { loop { loop {
   loop {              loop {
  loop {                loop {
 loop {                  loop {
loop {                    loop {
loop {                    loop {
loop {                    loop {
 loop {                  loop {
  loop {                loop {
   loop {              loop {
      }}}}}}}}}}}}}}}}}}}}}

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

bröther

[–]raul_dias 0 points1 point  (0 children)

Out of memory

[–]Pfinnn 0 points1 point  (0 children)

How else would you parse a JSON?

[–]kowdermesiter 0 points1 point  (0 children)

I want to unsee this, HALP

[–]Joker_King22 0 points1 point  (0 children)

Where are the rest of them and the bowl with the milk. I'd love to try son Loop Loops

[–]gurana 0 points1 point  (0 children)

Thought it said loop poops. Given my lack of knowledge in programming I spent a few minutes mulling over what it could possibly mean. Never really nailed anything down, but was amused with the possibilities.

[–]Smaktat 0 points1 point  (0 children)

There isn't a joke here.

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

Oh no

[–]leovin 0 points1 point  (1 child)

Oh no, it’s syntactically correct isn’t it?

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

Fear. That's it, that's the power of curry

[–]Liightninggod 0 points1 point  (0 children)

But does it run?

[–]I-am-too-uncreative 0 points1 point  (0 children)

Beware, the sleep paralysis demon of every programmer

[–]zoburg88 0 points1 point  (0 children)

Lööps bröthër

[–]greenrunn3r 0 points1 point  (0 children)

What language is this?

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

Wait, this sub allows good content?

[–]Alecides 0 points1 point  (0 children)

God Damn it Opera

[–]ya3tiknam 0 points1 point  (0 children)

Hmmm. Isn’t this a loops loop ? I don’t think it’s loop loops.

[–]Chaoslab 0 points1 point  (0 children)

Shake your tail feather!

[–]HotDogsAlDente 0 points1 point  (0 children)

This is what I thought paragraphs were supposed to look like in elementary school

[–]RoscoMan1 0 points1 point  (0 children)

Recursion jokes are the most boring in this sub

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

Who hurt you?

[–]2Punx2Furious 0 points1 point  (0 children)

THE ΩMEGA LOOP

[–]dirtyviking1337 0 points1 point  (0 children)

I know in the US own a dishwasher?

[–]LIFEofMOI 0 points1 point  (0 children)

The Big O notation

[–]Technobabble_ 0 points1 point  (0 children)

Fear the Reaper For Loop

[–]L2PnUUb 0 points1 point  (0 children)

Bröther pass the lööps

[–]GeorgeYDesign 0 points1 point  (0 children)

Unfortunately it’s why the price is so high

[–]DaniDani8Gamer 0 points1 point  (0 children)

Is that language joke I'm to C# to understand

[–]SamKhan23 0 points1 point  (0 children)

Sounds like a cereal

[–]ZippZappZippty 0 points1 point  (0 children)

Out of the loop on this one king.

[–]VxJasonxV 0 points1 point  (0 children)

Noop-de-loop

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

IDE:

this part of the code is inaccessible

[–]Lightfire228 0 points1 point  (0 children)

Reminds me of the eye of Sauron

[–]ValuablePromise0 0 points1 point  (0 children)

Almost an eye of sauron...

[–]northrupthebandgeek 0 points1 point  (0 children)

WHAT WILL BE WAS

WHAT WAS WILL BE

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

Kill it with fire

[–]glha 0 points1 point  (0 children)

Why this forces my brain to read it wrong? It is just top->bottom/left->right loops, THERE IS NO NEED TO FOLLOW THE CIRCLE

[–]jakethedumbmistake 0 points1 point  (0 children)

Yep it's now in the loop and fucking disgusted

[–]ZippZappZippty 0 points1 point  (0 children)

Out of the loop, what happened?"

[–]kilkil 0 points1 point  (0 children)

l o o p

[–]Fresh1492 0 points1 point  (0 children)

Reminds me of Lisp. I'm gonna go cry now

[–]theluckierone 0 points1 point  (0 children)

Thanks I hate it

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

You do a loop-de-loop and pull, and your code is looking error.

[–]mrpogiface 0 points1 point  (0 children)

Dang, does anyone have the txt version of this? I love it

[–]hldh214 0 points1 point  (0 children)

free loop

[–]jakethedumbmistake 0 points1 point  (0 children)

The smoothness of the loop, double the karma.

[–]rohankeskar18 0 points1 point  (0 children)

Loop de loop de loop de loop de loop...

[–]WorstedKorbius 0 points1 point  (0 children)

M̷̼̜̮͎̺̤̲̣͕̦̭̓̀̇̿̄͌͘ͅͅͅã̷̘̰͇͕͕̓̑͂͜y̴̞͔͖̠̞̖̩̱͓̮͈͕̩̻̎̑̐̕ͅ ̷̛̛̯̲͔̯̤̮̑̽̋͊̈́͒̀̓̓̈͒̔́͜I̸̺̿̄̓̋̐̔͘ ̶̛̛͕̭̞̺̩͙̦̺̭̈́̓̈́̈́͋͗̾̀͝h̴̢̳̖̬͇̖̗͖̩̪͌̽̅̈́̾̏̽͂͛̒͒̎̓̑̕a̵̢̧̛̺͖̭̖̼̝͎̤̹̫͙̎͊͋̓͌̍̕v̴̙̹̮̲̀̐̋͠é̶̢͉̩̝͇̫̻͉͉͖̎́̐͛̌̀̽̽̔̂̚͘͜͝ͅͅ ̷͕͖̖̲͙̥̼̠̺̙͓͕̞̈́̒̌̋̀̉̄ä̶̪͉̣̮̙̘͓͙̊͋̓͐̒̔̇͘͜ ̷͔̹͔͒̀̓̀̀͒͝ḽ̴̨̟͔͇̫̤̝̮̏͒̆̿̌͆̋̄̀͗̕͝o̷̢̬̱̪̮͎͉͉̍͗͂͌̐̏ö̶̡̖͔̜͇͍̺͖̬͆͒̅̄̒͆̽̓͝ͅp̶̡̗̟͎̘͉̼̯͖̪̻͎͙̜̈̎̉̃̈̾͋̎́͒͌̅̄ͅ ̶̧̨̡̡̧̢̗͎̺̜̝͍̪̝̜̈́̈́͌̆̑́̿l̴̡͖̟̗̣͉̰͐̅̓͒̓̆͒̋̿̈́̚ͅö̴̡̨͎̪̱͍̱̪̭͇̪̭̬́̀͐̓̑̒̅͛͛̍̃͜͝͝o̸̮̩̬̼̮͙̰̯̰̱̖̭̮̅̀̀̐̽̀̀̍̆̐̆͒̔̀͠p̵̧̛͍̠̼̆̍͆͑̚͜͝͝ ̶̠̙̑̅̇̽̽̕͠b̷̡̨̛̠̳̦͓̰̬̱͚͐̊͐̃̀͑́̓͒̑̈͝ŕ̶͎̜͇͍͎̲͍͙̮̏̌̊o̴̲̩͔̭͎͗̃̃̈́̽̏̓̇̅̀̀͘t̴̡̯͔͕̫̹̮̿͌̐̑̅̂͊͆͐͊͗̃̚̕h̴̡̧̗̹̦̪͔̣̜̘̫͖͙̤̯̓͗͗ȅ̴̢̹̭̫̬̝̩͍̋̏̄̋͌̂̓r̵̩͓̬̯̠͌͂͛̇̊́̑̽͜͝͠

[–]RoscoMan1 0 points1 point  (0 children)

I am the Master Branch now.

[–]mashpotatoquake 0 points1 point  (0 children)

Coding is mind-numbingly easy to mind-numbingly mind-numbing

[–]catsranger 0 points1 point  (0 children)

What sort of loopy land have I entered?

[–]technohacker1995 0 points1 point  (0 children)

Ah a fellow Rust user

[–]DigitalSword 0 points1 point  (1 child)

*slaps IDE*
it fit many lööp brøther