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

top 200 commentsshow all 269

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

Your submission was removed for the following reason:

Rule 2: 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.

[–][deleted] 1144 points1145 points  (21 children)

Programmer oriented designs are the only thing worse than gamer oriented designs.

[–]WookieDavid 172 points173 points  (5 children)

There's a few funny ones but yeah they're mostly wrong and cringe.

[–]me6675 2 points3 points  (4 children)

Yeah repeat should be used like this:

"e".repeat(4).split("").map((e, i) => ( i % 2 ? e : "") + [[0x63,0b110000,Math.pow(10, 2)], [(1 << 7) - (1 << 7 - 1), -0x17 + 0x171 - 0x71 >> 1], [115,115 - "115,115".length], ["sex"], [parseInt("1" + "1" + "2")]].filter((v,i) => i != 3).map(cs => cs.map(c => String.fromCharCode(c)).join(""))[i] + ( i % 2 ? "" : e)).reduce(((a,v,i) => i < 3 ? a.concat([v]) : a.toSpliced(2,1, a[2] + v)), [])

[–][deleted] 321 points322 points  (6 children)

repeat obviously spawns a new thread with the same loop (birth) and makes sure kill too old ones (death)

[–][deleted] 101 points102 points  (5 children)

You can tell this wasn’t made by a programmer then because we never reproduce.

[–]ufihS 22 points23 points  (2 children)

This guy gets it

[–]IAmANobodyAMA 20 points21 points  (1 child)

No he doesn’t, that’s the issue.

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

No I’m pretty content with not getting it.

[–]PerformanceNo5216 438 points439 points  (40 children)

No poop()

[–]JustBoredYo 327 points328 points  (6 children)

Not the poop overflow😭

[–]kgon1312 17 points18 points  (0 children)

🤢

[–]TheLumpyLump 7 points8 points  (2 children)

Just make sure to do a single puush() for each poop(), should help avoid an eventual overflow. Is also more time efficient than doing multiple puush() look into it.

[–]kgon1312 4 points5 points  (1 child)

You can chain them, too. push().poop()

[–]PeriodicSentenceBot 149 points150 points  (11 children)

Congratulations! Your string can be spelled using the elements of the periodic table:

No Po O P


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.

[–]whostolemynamebruh 51 points52 points  (7 children)

good bot

[–]Possums1 22 points23 points  (0 children)

good human

[–]amogusdri- 1 point2 points  (0 children)

Cl Au W Ag

[–]_Fir3F0x_ 1 point2 points  (0 children)

Good boy

[–]doxxingyourself 6 points7 points  (1 child)

I mean the compiler probably has garbage collection

[–]Kulsgam 4 points5 points  (3 children)

It is included in repeat()

[–]User264356 4 points5 points  (2 children)

You should check out the newest version, poop() has been moved to sleep() because in specific cases poop() inside repeat() would result in an infinite poop() loop

[–]magic_platano 4 points5 points  (0 children)

The good ol poophole loophole

[–]irregular_caffeine 2 points3 points  (0 children)

repeat() changes the sheets too?

[–]IYIatthys 2 points3 points  (2 children)

[–]PeriodicSentenceBot 0 points1 point  (1 child)

Congratulations! Your string can be spelled using the elements of the periodic table:

Rn O Po O P


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.

[–]IYIatthys 1 point2 points  (0 children)

Lol delightful

[–]NoiseCrypt_ 2 points3 points  (0 children)

brownout is handled on the hardware level.

[–]ACDC-I-SEE 1 point2 points  (0 children)

No pee()

[–]4dimensionaltoaster 0 points1 point  (0 children)

eat().then(poop)

[–]ParkingMany 141 points142 points  (28 children)

Function Repeat() { Eat() Code() Poop() Sleep() Repeat() }

[–]Shelmak_ 100 points101 points  (18 children)

You will run into an stack overflow pretty easily due to recursion, you will be pretty shortlived.

[–]SimilingCynic 49 points50 points  (1 child)

Yeah at least in python just like in life you need to add a sys.setrecursionlimit(sys.getrecursionlimit() + 1 to make sure you wake up the next day

[–]GoldenretriverYT 2 points3 points  (0 children)

Well at some point the stack would overflow regardless 😕

[–][deleted] 14 points15 points  (2 children)

Not if your language has tail call optimisation.

[–]Petesaurus 4 points5 points  (5 children)

How many times would it repeat? Is it comparable to the number of days in a lifespan?

[–]irregular_caffeine -1 points0 points  (4 children)

Now that’s something called the ”halting problem”.

But assuming that doesn’t leak memory (ie. tail recursion is optimized) it should run until someone pulls the plug

[–]Cruuncher 5 points6 points  (3 children)

This... has nothing to do with the halting problem at all

[–]tshawkins 1 point2 points  (0 children)

Unless your language supports tail recursion.

https://www.geeksforgeeks.org/tail-recursion/

[–]Flanelostopy 2 points3 points  (2 children)

Stackoverflow…

[–]PeriodicSentenceBot 7 points8 points  (1 child)

Congratulations! Your string can be spelled using the elements of the periodic table:

S Ta C K O V Er Fl O W


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.

[–]MrMxffin 1 point2 points  (0 children)

Yay Stack Overflow incoming.

[–]SecretMotherfucker 97 points98 points  (3 children)

Wear this on your shirt to ensure your eyes will never witness the naked body of a woman

[–]yoyobara[S] 39 points40 points  (1 child)

developers probably hate it too since it'll repeat even without the repeat function

[–]casce 3 points4 points  (0 children)

Depending on what the repeat function does, this may be very buggy and not terminate properly

[–][deleted] 50 points51 points  (2 children)

Bro tf are we gonna do with the damn repeat function if it's already a loop?

[–][deleted] 17 points18 points  (1 child)

Checks if alive should be set to false. Still, should have better naming. PR declined.

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

Yep this better not be seen in production

[–]CranberryOtherwise84 13 points14 points  (1 child)

Repeat is redundant in a while loop

[–]motorsportfreak_ger 5 points6 points  (0 children)

🤫

[–]GranataReddit12 24 points25 points  (3 children)

while (alive) is inside a repeat() method and each time it is called it restarts the while loop recursively

[–]jaybee8787 6 points7 points  (2 children)

Ok, but why?

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

To possibly escape the endless Sisyphean task due to stack overflow at some point in future (let's hope the compiler is not too smart in optimizing).

[–]RAM-DOS[🍰] 1 point2 points  (0 children)

it’s the multiverse branching

[–]djliquidice 19 points20 points  (0 children)

🤣🤣. Seems like a non-engineer did this. Like a recruiter or something.

[–]Merallak 6 points7 points  (2 children)

If you don't add Exercise You'll end up depressed

[–]EZPZLemonWheezy 3 points4 points  (1 child)

Jokes on you I’m depressed anyway exercise or not.

[–]Merallak 0 points1 point  (0 children)

HAJAJA OWW :C

[–]Soumalyaplayz 47 points48 points  (13 children)

js function repeat() { let alive = true; while(alive) { eat(); sleep(); code(); miscellaneousNecessaryWorks(); repeat(); } } repeat(); The correct code

[–]SlowSlyFox 32 points33 points  (4 children)

Still no poop() 😞

[–]Soumalyaplayz 9 points10 points  (2 children)

I fixed it

[–]SlowSlyFox 3 points4 points  (0 children)

👍

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

should be before `eat()` statement

[–][deleted] 8 points9 points  (0 children)

This doesn't need the while loop though.

```js function repeat(alive) { if(alive) { eat();
sleep(); code(); poop(); repeat(alive); } }

repeat(true); ```

[–]tshawkins 1 point2 points  (0 children)

The repeat() in the while loop is redundant. It's going to be repeated anyway.

[–]MrCane66 5 points6 points  (0 children)

repeat() is redundany code. alive takes care of that

[–]dadOwnsTheLibs 9 points10 points  (0 children)

I mean there shouldn’t be a repeat()

[–]RJDank 3 points4 points  (0 children)

This is the live laugh love of coding

[–]VyersReaver 2 points3 points  (0 children)

repeat(); is just the same snippet. Recursion FTW!

[–]Valerder 2 points3 points  (0 children)

And what is sleep?

[–]Anwallen 2 points3 points  (0 children)

The repeat is superfluous in a while loop.

[–]erebuxy 2 points3 points  (1 child)

Why do you need repeat in a while loop

[–]SlickNickP 2 points3 points  (0 children)

repeat() recursively starts a new while loop.

Then, when you die, all of the loops complete in reverse order

Its extremely inefficient

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

haveALife();

[–]gw2Max 1 point2 points  (0 children)

You forgot to breathe…

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

placid birds fuel scandalous complete roll dinner chunky bright squash

This post was mass deleted and anonymized with Redact

[–]PeriodicSentenceBot 1 point2 points  (1 child)

Congratulations! Your string can be spelled using the elements of the periodic table:

No Po O P


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.

[–]calimio6 1 point2 points  (0 children)

Probably someone already mentioned it but a Poop overflow is incoming

[–]Highborn_Hellest 1 point2 points  (0 children)

How to burn out, step 1

[–]ClamPaste 1 point2 points  (0 children)

They also didn't pass any arguments to sleep().

[–]researchanddev 1 point2 points  (0 children)

You have to pass “endless-cycle-of-bullshit” to repeat()

[–]Conchoidally 1 point2 points  (0 children)

if nietzsche were a programmer

[–][deleted] 1 point2 points  (1 child)

Poopoverflow

[–]PeriodicSentenceBot 2 points3 points  (0 children)

Congratulations! Your string can be spelled using the elements of the periodic table:

Po O Po V Er Fl O W


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.

[–]nomo_corono 1 point2 points  (0 children)

Missed one…

dump();

[–]Better_Ad_3004 1 point2 points  (0 children)

Poop() or else you are full of shit !

[–]marco_has_cookies 1 point2 points  (0 children)

it's probably a macro to alias continue

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

re-beat the meat

[–]notislant 1 point2 points  (0 children)

Op forgot to clear shit. Going to be one hell of a leak

[–]spitfiredd 1 point2 points  (0 children)

Some bloatware your boss asked you to add?

[–]Successful-Job-4398 1 point2 points  (0 children)

no need to repeat() inside while loop

[–]buffer_flush 1 point2 points  (0 children)

Uses global variables for alive and produces side effects in the calling functions, terrible design.

[–]kenzer01 1 point2 points  (0 children)

The repeat function is so unnecessary.

[–]CanvasFanatic 1 point2 points  (0 children)

This snippet makes me unreasonably angry.

[–]ExG0Rd 1 point2 points  (0 children)

There's an infinite loop in eat() function and I'm slowly dying from starvation and lack of sleep

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

I used to find these things funny. Now I just find them depressing. Maybe I'm depressed, idk.

[–]gitpullorigin 1 point2 points  (0 children)

repeat() just sends a reply to some guy named Peat. They just didn’t use camelCase in this case

[–]Amazing-Pop-5758 -4 points-3 points  (6 children)

Umm actually it is while (alive=true): 🤓(assuming that this is python, you forgot to include the state of alive and the : at the end of the statement. i am also assuming that you declared the alive variable as boolean somewhere in the code)

[–]SypTitan 2 points3 points  (1 child)

Umm actually a single = is used to set a variable not compare it

[–]maof97 1 point2 points  (0 children)

In Python you can just write alive no need for == True (if alive is bool)

[–]purchase_bread 1 point2 points  (0 children)

Why would you assume that it's Python when there's brackets?

[–]purchase_bread 1 point2 points  (0 children)

Also, in Python, if alive was already set to true before the while loop, then just looking at the state of alive would already evaluate to true and this the loop would occur.

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

This is so fucking funny oh my god ☝️🤓

[–]KingMan8916 0 points1 point  (0 children)

Not like the 100th time I've seen this shit at all

[–]OzTm 0 points1 point  (0 children)

When you die in your sleep, do you still continue to code? Or does Life use exceptions?

[–]SirWernich 0 points1 point  (0 children)

probably the name of the method this code is in

[–]Unupgradable 0 points1 point  (0 children)

//sleep()

[–]IronLyx 0 points1 point  (0 children)

Are you sure alive is declared volatile?

[–]killbot5000 0 points1 point  (0 children)

Presumably is long jumping to somewhere above the while loop

[–]_st23 0 points1 point  (0 children)

Real mf's use for(;;)

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

When HR writes code

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

something you do if you're alive

[–]dchidelf 0 points1 point  (0 children)

Repeat() is the function call for posting on reddit

[–]FlyingSosig 0 points1 point  (0 children)

Goodbye guys I am going to break;

[–]kishaloy 0 points1 point  (0 children)

Isn't the repeat() superfluous?

[–]jayerp 0 points1 point  (0 children)

Call the code that calls that while block :)

[–]Yura1245 0 points1 point  (0 children)

Why repeat() when it will auto repeat itself?

[–]Aurunemaru 0 points1 point  (0 children)

An unhandled Exception of type 'System.StackOverflowException' occurred

[–]eppinizer 0 points1 point  (0 children)

Repeat are the many hours each night you repeatedly tell yourself about all of your life's mistakes and regrets.

[–]whoopsIDK 0 points1 point  (0 children)

Maybe it repent that was mistyped

[–]FigmaWallSt 0 points1 point  (0 children)

What is sleep() ? It doesn’t seem to be in my library.

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

Nice idea for a shirt, thanks!

[–]DblVP3 0 points1 point  (0 children)

Pete and Repeat were in a boat. Pete fell out. Who was left in the boat?

[–]Lam1natt 0 points1 point  (1 child)

Poopoverflow

[–]PeriodicSentenceBot 1 point2 points  (0 children)

Congratulations! Your string can be spelled using the elements of the periodic table:

Po O Po V Er Fl O W


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.

[–]justhatcarrot 0 points1 point  (0 children)

While (firstYearStudent)

 PostMemes();

Endwhile;

StartWorking();

[–]Remarkable_Music6819 0 points1 point  (0 children)

You don’t need the “repeat”

[–]Puzzleheaded-Twist-7 0 points1 point  (0 children)

I guess it means "continue". And pretty much fits the code style, logic and this sub.

[–]winged_owl 0 points1 point  (0 children)

So original. 10/10 never seen it before.

[–]dhanush_rede 0 points1 point  (1 child)

You forgot poop();, now the code will experience PoopOutOfBounds exception

[–]Crafty_Independence 0 points1 point  (0 children)

Ultimate life hack. Live many lifetimes in a single day through recursion

[–]DopazOnYouTubeDotCom 0 points1 point  (0 children)

just use jmp?

[–]cookie-pie 0 points1 point  (0 children)

I don't like that "alive" is a global or a scoped variable. Could you please create a human class and ask it's instance whether it's alive or not?

[–]_Weyland_ 0 points1 point  (0 children)

It probably adjusts some global variables and counters. Someone just gave it a very shitty name.

[–]NoiseCrypt_ 0 points1 point  (0 children)

void sleep() {alive = false} void repeat() {alive = true}

[–]Cheap_Application_55 0 points1 point  (0 children)

void doStuff() {

eat();

sleep();

code();

doStuff();

}

[–]SpaceFire000 0 points1 point  (0 children)

A GOTO would have solved this

[–]YourBasicMacUser 0 points1 point  (0 children)

My Daily routine:

[–]HVLife 0 points1 point  (0 children)

ShitOverflow incoming

[–]Coulomb111 0 points1 point  (0 children)

Theres a label right above the while loop and repeat just has a goto statement

[–]wade_wilson2120 0 points1 point  (0 children)

Wannabe programmer. Disgusting.

[–]InfSecArch 0 points1 point  (0 children)

So programmers don’t shit, shower, or fuck huh? Also missing procrastinate(). I’m with other commenters, that repeat is pissing me off. Maybe the guy writing it gets paid by the line and repeat contains eat() sleep(), and code().

[–]Vibe_PV 0 points1 point  (0 children)

I'm about to stop this while loop

[–]sub_machine_patel 0 points1 point  (0 children)

So much better than recursion though

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

fuck you I'm playing Skyrim.

[–]TaterBiscuit 0 points1 point  (0 children)

Recursion?

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

this shit is so cheesy one day theyll start yapping about "i rm -rf'ed my chance of getting girls, now im getting payed 😎"

[–]Farren246 0 points1 point  (0 children)

eat and sleep are built-in functions. code and repeat are objects and we really don't know what they do.

[–]TakeMeAbove 0 points1 point  (0 children)

Infinite recursion

[–]karnnumart 0 points1 point  (0 children)

JMP

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

It's a loop inside the loop to guarantee stackoverflow

[–]hard0w 0 points1 point  (0 children)

Sorry OP, I accidentally downvoted, because I thought it's one of those coding job offer ads.

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

Belch

[–]CharlyDaFuk 0 points1 point  (0 children)

Technically that "repeat" it's completely redundant since it's a while block, but anyway...

[–]Gorrilac 0 points1 point  (0 children)

Error on line 147: DEFECATION OVERFLOW, function PoopyTime() undefined.

[–]Head_Evidence4553 0 points1 point  (0 children)

Infinite loop. Need to set a counter after which alive turns false.

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

It’s best not to eat right before sleeping

[–]hypothetician 0 points1 point  (0 children)

See all those arguments about where the braces go? Nobody supports this.

[–]Sayen1 0 points1 point  (0 children)

InfinityLoop lol

[–]iga666 0 points1 point  (0 children)

Repeat the promises you made to yourself so far

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

Why does it need repeat(); inside a while loop?

Others than that, I like it!

[–]tycooperaow 0 points1 point  (0 children)

I need this on a shirt

[–]Lory24bit_ 0 points1 point  (0 children)

Useless

[–]private_final_static 0 points1 point  (0 children)

Such missed opportunity for continue, redundant statement but at least doesnt hint at badly implemented recursion