Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Finally, a recursion joke that is not about infinite recursion!


Well, strictly speaking it is. There is no terminating condition- the OP simply chose to return at an arbitrary point in the recursion.


Is it? In the outer "real world" the bartender will give the programmer a drink for a joke. It could be a knock-knock joke or anything, but the programmer makes it recursive. Thus making the whole thing a joke to us, otherwise it would be a knock-knock joke embedded in a pointless programmer/bartender reference.

In the first joke level, the bartender will give the programmer a drink for a joke; it doesn't work to arbitrarily end here because "a programmer asks the bartender for a drink and the bartender gives him a drink" isn't anything like a joke to qualify at the parent level.

The next level is another layer of recursion and here the programmer can literally ask for a drink and get one even though that isn't funny in itself because it can be funny in the context of the outer joke using "he asked for a drink and got one" as a cheeky way to tell a joke to get a drink, and because it's a reference to recursion, the reason for Chekhov's Programmer in the opening sentence, so making something that qualifies as a joke to get the real world programmer a real world beer.

Seems to me like it's the earliest point it could return and still potentially work, rather than an arbitrary point?


I thought it stopped due to exhausting the bar's stock, which conveniently was limited to only three drinks.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: