O'Reilly logo

Beautiful JavaScript by Anton Kovalyov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 it down twice, with quotation marks around ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required