CHAPTER TWELVE

Coding Beyond Logic

0. The Basement

“Check it out!” I sat in a beat-up beige armchair in the basement of a college apartment building, staring at a jumble of charts, icons, and code. Two physicists-in-training beamed down at me. One of them said, “It’s pretty simple. You know what it does, don’t you?”

I paused, eyebrows raised, scanning the lines back and forth. The code read like a chalkboard full of high school algebra.

“No,” I shrugged. “You wrote a few loops and built a graph, but I have absolutely no idea what this code actually does.”

As they explained the graph, I couldn’t stop thinking. Where were the well-named variables? Where were the comments? Who taught them to code?

1. Quine’s Paradox

William Van Orman Quine was a logician who explored the limits of self-reference (along with many other philosophical and logical concepts) throughout the 20th century. In his essay “The Ways of Paradox,” he explores how indirect self-reference can be applied to the liar’s paradox (“The following statement is false. The preceding statement is true.”). Aside from reading like a convoluted interview question, Quine’s paradox unintentionally laid the foundation for a programming puzzle that has persisted for decades:

“Yields a falsehood when appended to its own quotation” yields a falsehood when appended to its own quotation.

This sentence specifies a string of nine words and says of this string that if you put ...

Get Beautiful JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.