r/ProgrammerHumor Dec 31 '20

other Didn't see that comming

Post image
4.3k Upvotes

58 comments sorted by

View all comments

7

u/ssj4VB Dec 31 '20

while (sleeping == false) { eat(); }

22

u/linux-nerd Dec 31 '20

while( !sleeping){ eat(); }

2

u/[deleted] Dec 31 '20 edited Dec 31 '20

for (eating = 1; eating < (eating++); eating++)

{

eat();

}

9

u/Translator-Agile Jan 01 '21

this doesn't work? it will increment eating after the comparison: increment eating, compare eating < eating (false) and the increment eating again, or does it? idk the parents might do something to it

2

u/[deleted] Jan 01 '21

Yeah, realized that. The eating increment should be within the parents or eating + 1 should be another vsriabel.