2012-12-21
Explanation
This comic imagines a caveman-era computer science class where a teacher asks students to explain the "frogSort" algorithm. A student describes a sorting algorithm that uses frogs: you place a number of dead flies in each box corresponding to each integer, then put a frog in each box. Since more flies take longer to eat, the frogs leave the boxes in order from fewest to most flies, producing a sorted list. When asked the maximum number of steps, another student answers "log_frog(boxes)." The teacher assigns homework to "program frogSort on home frogputer," and later a frustrated student complains about getting an "off-by-frog error."
The comic is a wonderful computer science parody that translates real concepts into a caveman/frog idiom. "FrogSort" is an analog of real sorting algorithms (it resembles a biological version of sleep sort, where items are sorted by assigning delays proportional to their values). The "log_frog(boxes)" complexity answer parodies algorithmic complexity notation like O(n log n). The "off-by-frog error" is a play on the "off-by-one error," one of the most common and frustrating bugs in programming. The humor works on multiple levels: the absurdity of cavemen doing computer science, the surprisingly coherent algorithm design using frogs, and the fact that programming frustrations are apparently universal across all of human history.