Reading What color is Your Function is perhaps one of the better explanations for why Continuation-passing Style or CPS is actually useful. Whether that’s intentional or merely a side effect, I’m not sure. But, I also can’t help but snicker at the quip, “No one ever for a second thought that a programmer would write actual code like that.”

Some with more of a study in computer science topics might be familiar enough with continuations, to be thinking of them as you reach the middle of the article. But I imagine that it’s a fairly niche topic by now, given Scheme and relatives aren’t that common in the wilds. I remember reading about continuations and CPS as a young programmer, and deciding that as cool as the trick was, it would be best not to write code like that without good reasons–because no average code monkey would understand it.

As Mr. Nystrome phrases it, it’s really bizarro way to represent code. But also one that is quite useful in situations that lend itself well to it.

I also find it a somewhat ironic dichotomy, that one of the things that really fascinated me as a programmer was the concept of Higher-order Functions. Along with Jason Dominus’ book Higher-Order Perl, it’s one of those few concepts that truly altered the way I think about code. Perl in general was a language that made me appreciate the usefulness of many modern notations. Yet at the same time, I will also admit that I find programs that masterbate with endless layers of anonymous functions rather grumble some to parse. Like any good thing, lambdas and closures included, too much of a good thing can be a bad thing.