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
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
→ More replies (2)27
May 09 '25
My brother in all that is holy please
while(true) { if(glass.isFull()) { drink(); } else { summonIntern(); refill(glass); } }→ More replies (1)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)
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
2
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
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
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
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
May 09 '25
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
39
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
6
5
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
4
4
4
4
4
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
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
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
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
2
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
2
2
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
2
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
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
2
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
2
2
2
2
2
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
2
2
2
2
2
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
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
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
2
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
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
2
2
2
2
u/chihuahuaOP May 12 '25
The summoned intern just watching the glass getting refill is a power move.
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
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
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
1
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
1
1
1
u/dnbxna May 09 '25
(loop [glass]
(if (empty? glass)
(refill-with :intern glass :water)
(drink! glass)
(recur :glass))1
1
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
1
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
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



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.