1 The map and the territory
This book winds through a combination of two quite different things, both of which I believe will be largely novel to most of my readers. On the one hand, this is a puzzle book intended to be more “quirky” and “fun” than to serve as a tutorial or reference text per se. However, the puzzles I have chosen should make both beginners and experienced users of regular expressions question what is and is not possible within them—and perhaps what should and should not be done using them—and burrow into readers’ brains, as if some parasitic eidetic worm. This book is not without an overriding pedagogical subtext: I expect you to think differently, and indeed more productively, if you can solve these puzzles (or at least reflect upon my discussions of how one might solve them).
That is only the one hand, however. Many of us have a second hand, though few a third. Another curious puzzle has arisen in the last years, or even only over the last months, which is similarly ubiquitous, or pendingly ubiquitous, in the minds of us computer programmers. A class of software that I call “AI coding assistants” can often be made to write programming code on our behalf that is at once dumbfounding and very often just plain dumb. I have chosen two of the currently most popular such tools—Copilot and ChatGPT—and I hope that what I discuss more generally will be informative in our approach to any future such tools, however rebranded, refreshed, or enhanced they may be.