r/programminghumor • • May 09 '25

Fixed the logic

Post image
3.1k Upvotes

350 comments sorted by

578

u/onlyonequickquestion May 09 '25

Maybe I'm being whooshed, but this is still garbage, No semicolon after summonIntern and no closing parenthesis after glass.isFull() check. you need curly braces around your else branch statements, or refill(glass) will probably always get called. 

367

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

six complete imminent liquid nose bake tender march pot narrow

This post was mass deleted and anonymized with Redact

6

u/thats_what_she_saidk May 09 '25

I thought all the errors was intentional. If not, yes, you are the worst programmer alive

4

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

political price rich hunt airport nail bells abounding fuzzy work

This post was mass deleted and anonymized with Redact

2

u/lexicon_charle May 09 '25

Time to admit we are all just fucking assholes

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

air liquid direction doll books wine roof six abounding angle

This post was mass deleted and anonymized with Redact

2

u/lexicon_charle May 09 '25

So with regards to glass.fill() vs fill(glass). You would think that it should be the former but for the life of me I can't understand why it is the latter in python if you want to find out the length of an array.

→ More replies (3)

2

u/Kevdog824_ May 10 '25

Damn I would’ve thought this was a shitpost if you didn’t say anything. You fumbled

2

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

cats obtainable edge wild nose governor rob sharp books sulky

This post was mass deleted and anonymized with Redact

2

u/EffectiveCar5654 May 12 '25

Are you the intern?

1

u/zR0B3ry2VAiH May 12 '25 edited Aug 15 '25

memorize one swim pie bow airport flag frame rhythm attempt

This post was mass deleted and anonymized with Redact

2

u/susosusosuso May 13 '25

You truly are

1

u/zR0B3ry2VAiH May 13 '25 edited Aug 15 '25

cable observation pie plucky mysterious childlike touch shocking mighty head

This post was mass deleted and anonymized with Redact

2

u/Chaos90783 May 13 '25

Almost makes it look like every line is written in different languages where some do : or dont need ;

1

u/zR0B3ry2VAiH May 13 '25 edited Aug 15 '25

payment many cow dime like smile chunky aback pause sharp

This post was mass deleted and anonymized with Redact

146

u/onlyonequickquestion May 09 '25

Lol it's all good it just makes it funnier. Now someone can submit a fix for your fix. Just like real programming, it is an iterative process! 

31

u/DeerMysterious9927 May 09 '25

Should have version number some where

→ More replies (4)

6

u/Consistent-Hair-3890 May 09 '25

I really wish it were recursive though.

19

u/KHRZ May 09 '25

It's OK, now the summer intern will refill your glass after every sip. Well, except you didn't summon him yet.

11

u/DrFloyd5 May 09 '25

Also you should assign the summoned intern to a local variable and use that to reference to get your refill.

Unless the intern is a class variable used for other things.

var i = summonIntern();
i.refill(glass);

Also

summonIntern().
refill(glass);

Works too.

◡̈

5

u/ApocalyptoSoldier May 09 '25

Intern could be a global variable

→ More replies (3)
→ More replies (4)

6

u/TopRevolutionary720 May 09 '25

Actually you are not alive anymore. Cause this code forced you to drink so much water you exploded. /s

→ More replies (1)

5

u/Available_Status1 May 09 '25

Shouldn't it be intern.Refill()? Or are you just making that poor intern stand there and watch you refill the glass.

Also, something I didn't like in the original is it's not refilling when empty but when not full, so it should refill after every sip.

→ More replies (3)
→ More replies (19)

3

u/CreepaTime May 09 '25

So what you're telling me, is that not only did he not fix it, he made it worse? Hahaha

2

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

rain compare silky wrench depend chief humorous reach exultant sugar

This post was mass deleted and anonymized with Redact

4

u/_jackhoffman_ May 09 '25

Refill glass should always be called but should the summon intern. There's no reason for the else to be there. Take a drink and the glass will no longer be full.

4

u/Semperty May 09 '25

i’m still stuck on the “isFull.” the glass ceases to be full after one sip 😭

3

u/Azoraqua_ May 09 '25

Not to mention, logically even, what is the intern going to do? According to the code they’re just there, and who’s doing the refilling, with what even? And who is drinking, what exactly? And lastly, there may be possibly race conditions.

3

u/m2ilosz May 09 '25

Also if (!glass.isEmpty()) unless you want to refill a glass after every sip

2

u/[deleted] May 09 '25

also the while loop will always be running, meaning they'll never stop drinking/refilling. should be while(thirsty)

2

u/A-Feral-Idiot May 09 '25

I hate when my cup doesn’t compile.

2

u/psycholustmord May 09 '25

The issue is not the sintax anyway, this only let you drink if it’s full. And if not,it will summon the intern and then you still have to fill it yourself, the intern is presumably summonef but not used 🤓

2

u/fynn34 May 10 '25

Seems like engagement bait

→ More replies (14)

46

u/dhnam_LegenDUST May 09 '25

Mind the indentation dude

73

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

enter childlike sense whistle continue seed rhythm edge handle scary

This post was mass deleted and anonymized with Redact

79

u/Many-Resource-5334 May 09 '25

Where are the closing } around if and else

6

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

governor sable cooing bow act theory coherent society tart square

This post was mass deleted and anonymized with Redact

→ More replies (1)

20

u/Bitter_Fly_1870 May 09 '25

Don't forget the parentheses around the if and that random dot at the end of summonIntern()

→ More replies (5)

7

u/[deleted] May 09 '25 edited May 10 '25

Still wrong, bruh is not that hard 😭😭😭

5

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

spotted seed divide attempt pet absorbed ripe imagine recognise tease

This post was mass deleted and anonymized with Redact

27

u/[deleted] May 09 '25

My brother in all that is holy please

while(true) {
  if(glass.isFull()) {
    drink();
  } else {
    summonIntern();
    refill(glass);
  }
}

20

u/0xbenedikt May 09 '25

Still need to have the intern refill the glass, but only when needed:

while (true) {
  if (!glass.isEmpty()) {
    drink();
  } else {
    summonIntern().
    refill(glass);
  }
}
→ More replies (9)
→ More replies (1)
→ More replies (2)

31

u/TheGuyWhoReallyCares May 09 '25

I think it should be when the glass.isNotEmpty()

Else as soon as you take one sip, the glass stops becoming full and you'll have to summon the intern each time to refill one sip.

Unless you intend to disrespect the intern like that, in which case the code is fine at least, the behavior might not be.

12

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

run squash mighty imagine encourage encouraging existence money desert shy

This post was mass deleted and anonymized with Redact

2

u/tecanec May 09 '25

I thought it would just spill over onto the floor.

2

u/jakeStacktrace May 10 '25

I only drink from full glasses but I'm also not a peasant.

15

u/_Figaro May 09 '25

Fixed?? First of all, you're missing the closing ) on line 2. Second, the indentation is all messed up; the else and the final closing } should be shifted a tab left.

You would not survive code review at my company.

2

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

crush ad hoc enjoy expansion workable divide encourage oatmeal quiet sparkle

This post was mass deleted and anonymized with Redact

8

u/tincho_ctrl May 09 '25

Oh, I hate you

2

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

tap unique nutty obtainable vase pause wise rinse direction alleged

This post was mass deleted and anonymized with Redact

6

u/_Undo May 09 '25

This is a syntax error in every language out there

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

fragile sophisticated head touch plough plants vanish payment shelter sort

This post was mass deleted and anonymized with Redact

3

u/UMAYEERIBN May 10 '25

This has got to be rage bait. I’m done.

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

public cause person repeat reminiscent versed abounding squeeze vegetable tan

This post was mass deleted and anonymized with Redact

3

u/YoJames2019 May 10 '25

What the fuck is this

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

makeshift abundant busy boat violet market ring scale possessive melodic

This post was mass deleted and anonymized with Redact

5

u/Tasty-Entertainer-82 May 09 '25 edited May 09 '25

no you didn’t. no language has this syntax.

yes, you added method calls. there’s still not semicolons where there should be, or closing parentheses and brackets.

if (glass.isFull()) { drinkGlass(glass); } else { summonIntern().refillGlass(glass); }

fixed it

1

u/[deleted] May 09 '25 edited Aug 15 '25

[removed] — view removed comment

2

u/Tasty-Entertainer-82 May 09 '25

yes? and this code would be a much better representation than what you wrote

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

dam paint history cats enjoy person crawl continue skirt attraction

This post was mass deleted and anonymized with Redact

149

u/driving-crooner-0 May 09 '25

First was bad but this somehow made it worse

2

u/PaulVB6 May 09 '25 edited May 09 '25

Why keep summoning an intern over and over?

var intern = summonIntern();
while(true) {
    if(!glass.isEmpty()){
        drink();
    }
    else {
        intern.refill(glass);
    }
}

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

simplistic encouraging engine station airport bright memory fine vegetable file

This post was mass deleted and anonymized with Redact

2

u/Dr__Wrong May 09 '25

Do we need to await the intern?

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

frame imagine fearless soft grandfather six price bake longing treatment

This post was mass deleted and anonymized with Redact

→ More replies (1)

2

u/[deleted] May 09 '25

Jesus this is still crap. Taking your approach, it should be something like

while (true){
  if(glass.isFull()){
      drink(glass);
   } else {
      const intern = Slack.summon(INTERN)
      intern.refill(glass)
   }
}

2

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

connect versed north shy cooperative badge thought tan unwritten cake

This post was mass deleted and anonymized with Redact

→ More replies (1)

2

u/ReallyMisanthropic May 09 '25

I prefer this:

do {
  glass.drink();
}
while (summonIntern() && glass.refill());

Drinking from empty cup should fail gracefully, but you don't want to be stuck in the loop if intern cannot be summoned or glass cannot be filled.

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

gray test hungry sheet roof correct continue bedroom normal plough

This post was mass deleted and anonymized with Redact

2

u/ReallyMisanthropic May 09 '25

setInterval calls that every second, meaning you'll eventually have a ton of while-loops running that never end. Remove either the while loop or the setInterval part.

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

meeting sable deer marvelous flowery consist fragile quickest lavish bells

This post was mass deleted and anonymized with Redact

2

u/Apprehensive_Luck823 May 09 '25
setInterval(() => {
  user.drink(glass);
  if (glass.isEmpty()) { 
    user.refill(glass);
  }
}, 60000 * 5);

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

grandiose reply sheet cows dolls disarm office teeny soft ripe

This post was mass deleted and anonymized with Redact

2

u/Wertbon1789 May 09 '25

Mid-way can't decide if it's C, Python or LISP. (because of the brace that wasn't closed)

Either way, not even Javascript would accept that shit... I have to buy such a glass just to annoy my colleagues.

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

marble spectacular pen modern chunky offer divide exultant fearless deer

This post was mass deleted and anonymized with Redact

2

u/Disastrous_Way6579 May 09 '25

A true engagement genius

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

include direction snatch screw office march distinct quickest observation different

This post was mass deleted and anonymized with Redact

2

u/andarmanik May 09 '25

onFull((user, mug) => {

user.drinkFrom(mug);

});

onEmpty((intern, mug) => {

intern.fillTo(mug);

});

Event driven design

1

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

rain upbeat connect subsequent run lip heavy vase profit snow

This post was mass deleted and anonymized with Redact

2

u/Miclemie May 09 '25

Why add “while (true)” like it could ever be false?

2

u/zR0B3ry2VAiH May 09 '25 edited Aug 15 '25

offer groovy sleep attraction bike march like escape chop run

This post was mass deleted and anonymized with Redact

2

u/[deleted] May 09 '25

eeeeeeeeeee.....

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

airport jar desert office bells amusing afterthought shocking zephyr familiar

This post was mass deleted and anonymized with Redact

2

u/turbulentFireStarter May 09 '25

the idea that an actual programmer wrote this is laughable. for your own sake OP, i truly hope you are a previous generation LLM.

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

possessive roll makeshift lunchroom soup ancient unique encouraging gray slap

This post was mass deleted and anonymized with Redact

2

u/baileyarzate May 10 '25

So, I take a drink and then an intern refills my glass? What is defined as a drink? A sip? A single molecule leaving the glass? Also, what in the syntax am I looking at? Why am I even commenting this is an obvious shitpost

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

office voracious relieved punch compare innocent yam strong thumb caption

This post was mass deleted and anonymized with Redact

2

u/GabeN_The_K1NG May 10 '25

This is so incredibly botched. No offense but do you just guess what to type?

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

vase cautious party alleged subsequent strong snatch spotted price jar

This post was mass deleted and anonymized with Redact

2

u/buildmine10 May 10 '25

This is the most cursed syntax I have seen.

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

degree escape handle engine bike doll future ripe soup seemly

This post was mass deleted and anonymized with Redact

→ More replies (1)

2

u/Am_Guardian May 10 '25

UNCLOSED PARENTHESIS

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

follow plough command imminent friendly chase tart provide zephyr coherent

This post was mass deleted and anonymized with Redact

2

u/AppropriateSpell5405 May 11 '25

How the fuck you go and make it even worse?

1

u/zR0B3ry2VAiH May 11 '25 edited Aug 15 '25

live cover sand rich dazzling vast whole spotted wine entertain

This post was mass deleted and anonymized with Redact

2

u/L0neW3asel May 13 '25

shouldn't it be refill(glass, summonIntern()) since you need to pass the specific intern you called?

Also shouldn't summonIntern have a semi colon?

Also also, why are we refilling the glass THE MOMENT IT'S NOT FULL!?

1

u/zR0B3ry2VAiH May 13 '25 edited Aug 15 '25

hungry direction sink dazzling seemly scary ask books abounding slim

This post was mass deleted and anonymized with Redact

117

u/[deleted] May 09 '25

syntax still horrid

39

u/No-Island-6126 May 09 '25

This many errors in this few lines is insane

7

u/Drakahn_Stark May 09 '25

One sip later it is not full, the program has nothing to do and halts.

It should be != isEmpty

2

u/Digitale3982 May 09 '25

WHY DOES NO ONE NOTICE THIS

→ More replies (1)

6

u/jakester48 May 09 '25

How did you find a way to make it worse 😭

→ More replies (2)

5

u/Diocletian335 May 09 '25

This is my Python code after years of writing in Java

5

u/Ratstail91 May 09 '25

I get what you're saying, but you're talking to a sub full of autist-level pedants, and your code wouldn't compile, so the responses are funnier than the original joke.

4

u/ErikLeppen May 09 '25

You forgot a ) on line 2.

4

u/Embarrassed-Green898 May 09 '25

Horrible indentation.

4

u/[deleted] May 09 '25

Switch to goose farming

4

u/GREG_OSU May 09 '25

Gotta ask…

Please post drink and summonIntern methods…

4

u/Gillemonger May 09 '25

This gotta be a shitpost. I mean cmon.

4

u/No_Stuff2255 May 09 '25

Roses are red, violets are blue, missing ")" on line 02

4

u/shadowr333 May 09 '25

I think you and the intern need to switch jobs if this is how you write code lmaooo

4

u/Conman636 May 09 '25

Running while(true) on the main thread. Congrats now the program is frozen you can't even close it properly.

→ More replies (1)

7

u/why_1337 May 09 '25

WTF even AI would not make this many mistakes.

4

u/evie8472 May 09 '25

this is ai, the bottom of the Ls are different

1

u/Mrrrrggggl May 09 '25

May also want to specify what the glass will be refilled with. Otherwise you might have some unintended outcomes after the loop runs a few times.

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

air roof hospital dolls tidy march like ask coordinated truck

This post was mass deleted and anonymized with Redact

1

u/ITinnedUrMumLastNigh May 09 '25

No way that shit is gonna compile

1

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

meeting mountainous wipe carpenter tart sophisticated hungry bake plough weather

This post was mass deleted and anonymized with Redact

1

u/Ben-Goldberg May 10 '25

OP, Have you put a ")" put of sight on the side or the back of the glass?

2

u/zR0B3ry2VAiH May 10 '25 edited Aug 15 '25

birds summer safe snails entertain pet fall sheet office teeny

This post was mass deleted and anonymized with Redact

3

u/mokrates82 May 09 '25

Why would you summon an intern and then refill the glass yourself? What is the intern for?

also, what borked language is that that doesn't even check parentheses?

3

u/KingRupan May 09 '25

So you take one drink and then immediately call the intern to refill the glass? Seems like it could be more efficient if you drink until empty

3

u/SaltyInternetPirate May 09 '25

No, you didn't. You take one sip and then call the intern for a refill? You're a terrible coworker

4

u/[deleted] May 09 '25

This is worse than the last one tho

2

u/rde2001 May 09 '25

why would i only drink if the glass is full? isn't the idea that you drink it until it's empty, or at least has some of it left?

2

u/they_paid_for_it May 09 '25

More like, fix the syntax. Right, bros??

→ More replies (1)

2

u/DrFloyd5 May 09 '25

It feels right that there should be an await on summonIntern()…

2

u/dingo_khan May 09 '25

Poor intern, this poor logic will have them doing a refill after every sip.

Boundary conditions are important.

2

u/coderman64 May 09 '25

Fixed it:

There's no way it would even compile/run in that state.

→ More replies (3)

2

u/I_Am_Dilly May 09 '25

SummonIntern( () => { Refill(glass); });

2

u/Piisthree May 09 '25

summonIntern.refill(glass); ?

2

u/[deleted] May 09 '25

Shouldn’t there be a “return(glass)” in here somewhere or is the intern just refilling and holding onto it? Lol

2

u/Affectionate_Yak3121 May 09 '25

My belly keeps refilling even if it has some syntax error

2

u/Diocletian335 May 09 '25

"What programming language is this? Python or JavaScript?"

"Yes"

2

u/_v3nd3tt4 May 09 '25

So you summon the intern and then refill your own glass? What was the point of summoning the intern? So the intern can watch?

2

u/AngriestCrusader May 09 '25

There are so many problems in this

2

u/HypersensitivePotato May 09 '25

So you should only drink if the glass is full? Even if the glass is only missing like a few droplets?

although it's fun to think of an intern trying to refill a glass with only few droplets missing

2

u/lt_Matthew May 09 '25

You're calling two separate functions. It should be Intern.refill(glass)

2

u/[deleted] May 09 '25

Why summon the intern and then refill your own glass. Surely, the refill should be nested within the summons.

2

u/RepresentativeNeck63 May 09 '25

Look at you, being all cross platform with that SummonIntern(), Dave still uses the bare NTcommandServant().

2

u/xroalx May 09 '25

lgtm, *hits approve*

2

u/[deleted] May 09 '25

this has to be ragebait

2

u/[deleted] May 09 '25

you’re trolling us right?

2

u/Right_Atmosphere3552 May 09 '25

can't it be

while (glass.isFull())

as a bool true is implied

2

u/Varderal May 09 '25

Wouldn't isFull flag false after the first sip post refill? Lol

2

u/Brilliant_Slice9020 May 09 '25

Summonintern is not a defined function

2

u/csmit195 May 09 '25

Indentation is ugly, broken syntax (parenthesis). glass.isFull() likely returns if the cups liquid percentage is 100%. One sip = glass.isFull returns false, leading to an intern refilling after each sip. Why not move the refill to the glass class, or create an intern class, and use intern.refill(glass) as that'd make more sense.

2

u/[deleted] May 09 '25

Syntax error both in python and whatever the other language is.

2

u/TwistedKiwi May 09 '25

My eyes are bleeding, thanks! ))

2

u/ThoustKappa May 09 '25

This syntax feels like having a stroke.

2

u/viper26k May 09 '25

If this is rage bait, I was baited.

2

u/obi_wan_stromboli May 09 '25

Thanks I hate it

2

u/Rasta_Dev May 09 '25

I'd go for something like Intern.summon(refill);

2

u/Prestigious_Ad7838 May 09 '25

Need some DI on that intern func and then chain summon with refill... how else would the intern refill? You're basically refilling while the intern watches.

2

u/mnemonicpunk May 09 '25

Ignoring the syntax errors: Using this code you would only ever drink the first sip from the glass, if only a slight bit is missing you'd call the intern to refill, even after a single sip. Recommend checking !glass.isEmpty() instead.

Or go for a shot glass, I suppose.

2

u/MyPunsAreKoalaTea May 09 '25

Why would you first summon an intern just to then fill the glass yourself anyways?

→ More replies (2)

2

u/RooMan93 May 09 '25

Intern is summoned after every sip u take as the cup is no longer full

2

u/Corsac-416 May 09 '25

So only drink when it is full, take a sip and immediately go to else statement

2

u/Unknown_TheRedFoxo May 09 '25

What's the error handling code for whenever summonIntern() doesn't work?

2

u/LombardiD May 09 '25

this is why i dont use copilot

2

u/TonyMac129 May 09 '25
while (true) {
  if (glass.isFull()) {
    drink();
  } else {
    intern.summon();
    intern.fillGlass();
  }
}

2

u/ICreamSavage May 09 '25 edited May 09 '25

Can I just say, the drink is going to be refilled after every sip. This sounds tedious and annoying to put up with an intern that often

Edit: that said I'm probably still missing something but this is my shot at it

float glass = glass.isfull();
float empty = glass.isempty();
while(true) {
   if(glass.volume() != empty) {
      drink();
   } else {
      intern.summon();
      refill(glass,intern);
   }
}

2

u/TheCatSleeeps May 09 '25

Anybody wanna try "fixing" the code again?

2

u/EliSoli May 10 '25

Is that a real programming language?

2

u/Arc_Nexus May 10 '25

How is this fixed? Even ignoring syntax, you're taking one sip and refilling, for eternity. The poor intern going both ways with a basically full glass.

2

u/Monika_Skye May 10 '25

summonIntern()
BRUHHHH

2

u/TactfulOG May 10 '25

he's 100% rage baiting with this syntax. You can't tell me he put {} after if and : after else cause he didn't know better. Also brackets around the if statement, also close the else with curly braces, also semicolon after everything, at this point I might be missing something there's so many errors

2

u/tcharl May 10 '25 edited May 10 '25

My fix would have been

  
void manageThirst() {

  if (glass.isFull()) {

    drink();

  } else {

    summonIntern().refill(glass);

  }

}

void corporateEmployeeBehaviorAtAPartyTest() {

  Glass testGlass = new Glass();

  assertFalse(testGlass.isFull());

  manageThirst();

  verify(summonIntern).refill(testGlass);

  assertTrue(testGlass.isFull());

  manageThirst();

  assertFalse(testGlass.isFull());

}

void corporateParty() {

  while (true) {

    manageThirst();

  }

}

2

u/NecessaryIntrinsic May 10 '25

Compile error expecting )

2

u/UMAYEERIBN May 10 '25 edited May 10 '25

POV vibe coder tries writing code by themselves. /j

2

u/Mojo_Jensen May 11 '25

I can’t tell if this is rage bait or not lmao

2

u/RetroJon_ May 11 '25

I think someone intended to use a goto with else: being the target label.

2

u/chihuahuaOP May 12 '25

The summoned intern just watching the glass getting refill is a power move.

2

u/DukeOfSlough May 12 '25

This shit does not compile.

→ More replies (2)

2

u/Zakiothewarlock May 13 '25

So you're always just drinking or watching it get refilled without stop. Constantly pouring liquid down your throat

1

u/Accurate-Ad539 May 09 '25

Sure this is not a Google interview test?

1

u/Acceptable_Sell_4526 May 09 '25

To be fair he just summons the intern and then refills the glass, it's not obvious the intern does the refill. Really it should be something like refillGlass(summonIntern());

Or

var intern = summonIntern(); intern.refillGlass();

1

u/shiznit028 May 09 '25

Syntax error

1

u/armahillo May 09 '25

The if statement doesn't have a closing parens around its clause

The else statement uses a colon, but the if statement doesn't

summonIntern appears to be a statement but lacks a terminal semicolon

1

u/jax_cooper May 09 '25

I almost threw up seeing the syntax. I like your taste of humor.

1

u/nwbrown May 09 '25

Still broken.

1

u/roosterHughes May 09 '25

Every time I see one of these, I have the same thought: take one sip, and the glass is no longer full. You’re refreshing your glass after every sip!

1

u/Critical_Studio1758 May 09 '25

The joke is absolutely every line is wrong?

1

u/WombatWingdings May 09 '25

WTF language is that!?

1

u/punppis May 09 '25

Syntax error. Few times.

1

u/dnbxna May 09 '25
(loop [glass]
  (if (empty? glass) 
    (refill-with :intern glass :water)
    (drink! glass)
  (recur :glass))

1

u/AverageCodingGeek May 09 '25

My brain threw a compilation error trying to laugh at this

1

u/cpecer May 09 '25

git branch -d

1

u/beardedbrawler May 09 '25

while(true){

 if(glass.isNotEmpty()){

      glass.drink();

 }

 else{

      summonIntern().task(glass.refill());

 }

}

1

u/Decent_Cow May 09 '25

You're missing a closing parenthesis lol your code won't run. Funny idea, execution could use some work.

1

u/IMugedFishs May 09 '25

Where is the variable/object declaration?

1

u/Sea_Row_4735 May 09 '25

Instead of using glass use "this"

1

u/Arctos_FI May 09 '25

The if doesn't have closing bracet, else is indented wrong (should just use curly bracets like in while loop anyway, or not in either but not this kind of missmatch), SummonInter is called but not saved so the inter is lost right after method call, SummonIntern is missing semi-colon, why is the refill in your object and not in Intern object that gets created when summoning intern.

The correct code could be something like

while(true) {
    if (!glass.isEmpty()) {
        Drink();
    } else {
        Intern intern = new Intern();
        intern.Refill(glass);
}}

Also in this you could technically replace "Intern intern = new Intern();" line with "Intern intern = SummonIntern();", but that exepts the SummonIntern method with Intern as return type (so "private Intern SummonIntern() { ... }") is declared elsewhere in code. and the method body is just "return new Intern();".

Also theoretically there should be already list of interns instead of creating new one when glass needs to be refilled (as it's like hiring new intern instead of asking existing intern) so the line should be "Intern intern = interns[rnd.Next(0, interns.lenght-1)];" where rnd is Random() object and interns is array of Intern() objects. Also this can be hidden to SummonIntern() same way as if creating new Intern() object

So the code could be changed to following if you want to keep that method name "SummonIntern" (which is declared in the hidden parts of the code like declaration of glass object)

...
} else {
    Intern intern = SummonIntern();
    intern.Refill(glass);
...

2

u/Arctos_FI May 09 '25

Also the whole formating is kinda funny as it's now that you drink the whole time there is something in the glass and when it empties you ask intern to come refill it to you just start drinking again straight after it's refilled. There should be another if statement between the while and existing if that checks whether you're thirsty and include everything inside the while to that new if clause (also the else could be just another if so regardless of your thirst, you would ask the intern to refill the glass when it's empty

1

u/Geo_Seven May 10 '25

Great. Vibe drinking…

1

u/born_on_my_cakeday May 10 '25

(new Intern())->refull();

Chain it so your intern does the work not you on the next line sheeeeeeersh