A check that keeps postponing itself
Bogosort is a deliberately impractical sorting method: shuffle a list at random, check whether it is in order, and repeat until it is. This joke algorithm adds a second obstacle before that check. It makes a copy of the list, starts Bogosort on the copy, and then calls itself again instead of testing whether the list is sorted.
That call is recursion: a function starting another instance of itself. Here, each instance reaches the same instruction and starts yet another one. The sorting check sits after the recursive call, so execution keeps moving deeper into the chain rather than reaching the line that could finish the job.
Why the copy does not help
The copy might keep the original list unchanged, but it cannot break the loop in the program’s control flow. Every new call repeats the same sequence, creating more unfinished calls that must wait for the next one to return. Since none reaches the check, none returns normally to the call above it.
In a real program, the chain would eventually run into a practical limit, such as exhausting the available call stack—the memory used to track active function calls. The joke is that the algorithm does not merely sort badly: it puts the decision about whether to sort behind a call that prevents the decision from ever being made.






