When I get home from work, I sit down on my couch and open my laptop. When I’m waiting for the next bus, I pull out my iPhone.
Then there’s the unconscious ritual: email, RSS, Twitter, Facebook, Tumblr—maybe even Reddit if I’m not paying attention.
It’s not that I don’t do things. I do lots of things! But this is my default mode, my idle mode. The sink on the state machine graph. Some other force has to wrest me out of it.
What’s worse, in this mode, I’ll put off anything I see that might take thought. Hard email? Leave it. Long blog post? Send it to Instapaper. But yay, hooray: funny tweet, clever picture, keep it going, friendly email, don’t make me think.
How do I wish I idled? I’m not certain, but on a recent road trip, I realized to great alarm that I couldn’t remember the last time I’d pondered. Sure, I’d spend hours mulling problems I’d encountered in classes or life, but every thought was reactionary.
I hadn’t had a conversation with myself, found new questions to ask, really introspected.
No, I’m not condemning ubiquitous internet connections or Twitter or kids these days. It’s not about that. We used to blame TV for this, right? It’s not even always media: at school, I’d fill every spare hour with idle conversation. Sure, we need to have fun, and sure, some chats were enlightening, but since I was always surrounded by people, I spent absolutely no time inside my head.
Now I’m living alone for the first time in, well, ever. It feels utterly strange, and I have this primal urge to numb myself to the apartment’s stillness with lights, voices, stuff. I feel like I’m floating at the surface of this anesthetic sea, bobbing occasionally above for a breath of awareness.
So I’ve spent a lot of time recently with my eyes closed. I’m trying to keep the damn phone in my pocket. And you know what? It feels great.
I’m not sure if it’s out of nostalgia or some weird sense of duty, but I spend a lot of time thinking about how to teach software engineering to kids. In honor of Whyday, let’s trap a few of those jumbled ideas in text.
“Which language do we teach?” That’s often the first question when putting together a class. It’s the wrong question to ask, but let’s take it as “which tools will underlie our curriculum?”
Three key areas form the base of the software knowledge pyramid:
Algorithmic thought: how do I say “which of these numbers is biggest?” Hm, I’ll need this maxSoFar variable, then for each number…
Syntax: how do I express these algorithms in some language the machine can be made to understand?
Realities of the system: why can’t I wait for that thread to end with while(1);? Why can’t I int *foo() { int x = 4; return &x; }?
Students struggle with C as a first language because they’re forced to learn all three of these areas at once. It’s too much material, too long before they can make anything.
I tried teaching kids Ruby to avoid realities of the system, but they still wasted too much time tripping over syntax.
Many say Scheme is the way to go: no syntax; no realities. But when I tried to teach out of SICP, I tripped on a critical zeroth area:
Inspiration: I have to care enough after thinking “maybe I should learn to code” to trudge through chapters of boring foundational work.
My first childhood project was a text-based adventure, but when I dangled that carrot in front of today’s kids, they were indifferent. Most had never opened a terminal before; they didn’t care about making stuff trapped in this foreign, backwards world.
That’s why projects like Kodu, Alice, and Scratch are so exciting: their output feels real. A beginners’ system is only compelling if a kid can make something his non-technical friends would want to have. When he shows off his creation—when he hears “wow, how did you do that?!”—then he’s inspired. Then he’s hooked.
On the other hand, this is what a child sees when starting Alice:
Leave the insane Java interface alone. It knows its shame. Instead, notice two things: first, the empty game world; second, the library of every available feature, ready to be dragged into place. Some would call this design A Feature. Yes, for some students, it can excite and reward a sense of exploration. But for others, I think it’s scary, a thousand piece puzzle of an empty sky.
Instead, consider The Incredible Machine. This puzzle asks: “Can you make all three guns fire?”
Most of the scene is in place. The goals are clear. A limited toolbox provides the pieces of the solution, but there are many ways to solve the puzzle. Each level is brief, so there’s frequent reward.
Over time, the player learns how each of the pieces works, and the puzzles get more complicated. The toolboxes include unnecessary pieces; the game rewards clever alternate solutions. Then finally, the kid can move to the sandbox, where an unlimited toolbox is at his disposal, and it’s his turn to challenge his friends.
What if this kind of progressive disclosure were applied to software education?
Say one level is Checkers. But it’s broken: it lets you move cardinally, and not diagonally! Now fix it. The game’s pieces are already in place, and the necessary building blocks are provided in a toolbox.
Or: you’re playing a game with an impossible AI opponent. Change the rules so that you can win, but you only get to use these bits to do it. You get an achievement if you beat the AI with fewer changes.
Or: this level’s game is partially finished. How does it end? Share it with your friends!
Or: rule-changing bits have a spatial or temporal area of effect and must be earned or found; work together with friends in an online puzzle platformer wielding these programm-y “spells.”
One idea for framing the game: the whole world’s falling apart and broken, Lewis Carroll style. Everything’s backwards and incomplete, and the player is some kind of deity fighting the forces of entropy.
I don’t have the time or resources to make this thing, but it is fun to talk about. This progressive disclosure nugget is just one Idea, and I have a few more I’d like to toss around.
Particularly (since I’m a language nerd): what’s the language look like? I’ve been testing various systems by using them to make Settlers of Catan, Tetris, and Super Mario Bros, and I have some ideas at the intersection of visual, declarative, and event-driven programming, but that’s a topic I’ll leave until after further reading and experimentation.
Interested in discussing these topics? Please, write me.
My explorations in this field have been led by invaluable discussions with Ken Ferry, Ian Henderson, Joe Osborn, Chris Parker, David Smith, and Patrick Thomson. Thanks guys, for the content of this and future related articles—and for putting up with this topic in every conversation for the last two months.
Screenshot of The Incredible Machine from MobyGames.
Dear RSS / Tumblr Dashboard readers: This article has a fair amount of special formatting and an audio clip; you may want to read it directly on my site.
Wait, don’t run! This musical honeycomb has fascinating properties.
I developed this thing as a tuning exercise for my old a cappella group with Mike Smith, Jon Napolitano, and Johannes Pulst-Korenberg. I doubt we’re the first to see it, but I can’t couldn’t1 find any relevant papers, so.
Here’s an intervallic compass to help you orient yourself:
Pick any vertex on a hexagon, and the three neighboring tones form a valid major or minor triad. Because I’ve spelled every note with sharps to make the torus’s cyclic nature clear, these chords aren’t music-theory approved: C minor has E♭, not D♯. But they’re enharmonic.
You can move from any chord to any neighboring chord by moving just one note—a whole step if moving vertically; a half step if diagonally:
Moving like this, we’d wander a whiteboarded honeycomb as an exercise. Here’s what the above progression sounds like:
But now you’re feeling betrayed, bereft. Where’s the torus here? I’m no 3D painter, so you’ll need a little imagination to assemble it.
We’ll use the figure at right.
Start by folding each green number onto its mate, forming a tube made of rings moving in major thirds.
Then do the same with the orange numbers, twisting the tube so that D connects to A and so on. You’ll form a donut that spirals around the circle of fifths as you trace its rim.
So? On this torus, distance corresponds directly to dissonance.
Take C. Here are the closest notes, in order of increasing distance:
F, G, G♯, E, A and D♯, making fourths, fifths, thirds, and sixths;
D, A♯, B and C♯, making seconds and sevenths;
and F♯, making a tritone.
You can break these groups down further if you realize that folding the torus distorted its distances, but even this naïve ordering is remarkable.
I should print giant glossy posters of this thing for music classrooms. I don’t know any other way to get an amateur choir to sing an improvised chord progression.
As this blog trundled along, coyly playing ignorant of its audience’s identity or interests, I’ve found myself pondering an architectural landmine whose vague bokeh have only just come into focus.
Sparkle’s own SUUpdater suffers from this problem. It’s long felt ugly to me, but I couldn’t pinpoint why until I ran across another class with this design at work and realized I’ve seen it often.
External forces (notifications, I/O, callers, etc) cause it to change state.
After finishing (succeeding or failing), it can be restarted and reused.
Only some internal state persists when the machine is reused.
I hope an example will make this a little less opaque.
Sparkle’s SUUpdater is clearly a state machine, and it has a ton of internal state. You fire off an update; it transforms that internal state over some tree of operations. Then next time you fire off an update, some of that state is reset, and some of it is reused. And worse, you can ask it for that state anytime, even between updates.
I’ve got to remember to reset the check timer, while I’ve got to remember to persist any decisions the user’s made. And this Lovecraftian state machine has multiple entrance and exit points.
I don’t know about you, but I don’t trust myself to do the right things (including all the special cases) in all those places—and with good reason! I have a good track history of messing it up, and I’ve fixed enough bugs in others’ Unreliable State Machines to know they do too.
I’m not sure which Extreme Proper Noun Design Pattern should be applied here. Maybe it’s enough to make the machines single-use, returning a final state and created with the relevant bits next time.
Update: Jim Roepcke suggests the State pattern, which is a good solution, though I suspect it’d feel awkward unless class definition is light-weight. Instead of state classes, one could store sets of closures.
Tumblr Dashboard reader: this one’s a doozie, and it’s full of videos. You’d like this post better if you read it on my site.
On my first Ditch Day, I rappelled down an aeronautics building, hunted live uranium with a Geiger counter, had a 300-bolt roman candle melee, and sent an Air Force officer to the emergency room.
So when senior year rolled around, I naturally wanted to top that.
Sometime in May each year, Caltech seniors ditch classes. That would be a typical college tradition, but things escalated.
While they were away, underclassmen pranked seniors’ deserted dorms. One found a car assembled in his room; another’s was turned into a swimming pool. So the seniors built elaborate “stacks” to keep underclassmen out: steel and concrete walls, booby traps, vicious puzzles, and the like.
Over the decades, Ditch Day has mutated. It’s now an opportunity for seniors to create an unforgettable adventure for the friends they’ll soon leave behind. It’s by far the most anticipated day of the year.
The date of Ditch Day is a highly-guarded secret (it’s always “tomorrow”), but it’s clearly imminent when alumni arrive in droves to help the harried seniors.
Oh, and we were harried. I’d been working on my stack, “Sense,” as my full-time job for weeks with my math-major accomplice, Mike Smith.
The day before, I papered campus with strange posters to stir up confusion and discussion. At dinner, each senior made a theatrical announcement about his stack; I got up and described an incredibly sketchy string of facts I found while looking into the posters: “You probably shouldn’t sign any waivers from these guys.”
The morning of Ditch Day, the underclassmen awoke to seniors pounding on their doors and screaming: “Wake up, frosh! It’s Ditch Day!” Our courtyard was full of prospective adventures, with the flyer at the top of this post advertising mine.
There were eight tabs on the bottom of that flyer. So what did those Techers find when they called that phone number?
Our plot was driven by “Mindvision Laboratories,” a suspiciously boring corporation whose experiments were recently shut down by the FDA. They were looking for volunteers to be… off the record. Things got fairly more sinister as the day progressed.
After an opening video and breakfast, our stackers went through a nine-hour series of experiments challenging their senses. I’d like to highlight a few of my favorites and show you how we made them.
Balance / Telepathy
Our stackers arrived on a secluded rooftop between two taller buildings and found huge steel pipes forming a mobile above their heads. The rods were anchored to the opposing rooftops and hung akilter just out of reach.
Each pipe had a mercury tilt switch mounted at its center. When all three were level, a relay opened, and an audio clue to their next location played over loudspeakers.
Of course, we didn’t give instructions, here or in any other experiment, so part of the puzzle was: what is the puzzle?
By carefully coordinating who grabbed the bars where, they balanced the mobile and got their next location. But it also made a great toy, even after Ditch Day was over. Here are some friends playing with it:
My original plan for building this was along the lines of “Andy finds some rope, ties some overhand knots.” I mentioned it to a rock-climbing alumnus, who gently pointed out that the system is about 2,000 lbs under load and Andy let me teach you about ropes please.
Taste
I gave my stackers a Flip and told them to record their day. This is the hour they spent failing to solve this puzzle, compressed to two minutes:
Each student got a box of four gels, and each gel had three of the primary flavors: salt, sugar, acid, spice, and bitterness. Every box had an exact twin, and pairings corresponded to letters on a grid. When anagrammed, the letters spelled out the next location.
What about the clues they were reading? We didn’t give any instructions, but we left Remedial Envelopes stamped with “open by” times so they wouldn’t get too far behind—they had a full day ahead!
The gels were simply agar and food coloring, flavored with salt, sugar, vinegar, jalapeño, and orange peel. They were meant to be vile, but I still think these guys were being wusses about it.
Hearing
This one took place in the dark, so there are no good photos, but I’ll narrate it from the students’ perspective:
They arrived in a conference room dimly lit by a desk lamp. A sign read simply: “Hearing.” Two dozen speakers were mounted on the walls, ceiling, and furniture. Each had a button taped to it.
After some confusion, someone pressed a button. Suddenly, the light went out, it was pitch black, and the Ride of the Valkyries started playing out of one speaker.
They scrambled in the dark, randomly pressing buttons until someone hit the one on the Ride’s speaker. Silence—then all the speakers started loudly playing snippets of Bach fugues, at random offsets and rapidly shifting volumes.
One speaker also played the Ride. After a few seconds, they all shouted “MISSED!” The stackers pressed more buttons, but the room kept yelling “WRONG! Seven to go.”
Eventually they figured out the challenge: they needed to hit the button on the speaker playing the Ride before it moved after a few seconds, seven times in a row. That required a great deal of coordination in a pitch black, very loud room full of hazardous rolling chairs.
The whole thing was run by a script on a computer with five sound cards. Coordinating 24 independent audio channels was… exciting. The buttons were connected to a USB keycoder.
How’d I have the computer turn off the desk lamp? I carefully placed the power strip’s switch in front of the CD drive and made it eject.
I used almost 1,500 feet of double- and triple-conductor wire for this room, but it was all worth it for this very sweet note they left me:
Pain
This puzzle’s footage makes me giggle with disconcerting glee:
Some of the pairs of nails were connected to 15 volts. When the stackers colored in the live grid squares, they got a location:
There are so many more stories—including the one where I made them take unlabeled pills (miraculin!) in a dank maintenance room—but I’ll stop here to save some of those virtual trees I’m chopping down.
So that evening, awake for 41 hours, all I could think was: “I wanna do it again!” My kids are gonna have the coolest birthday parties.
Balance/Telepathy photo by Michelle Hasier. Video and flyer photo by Ilya Nepomnyashchiy.
I might have mentioned before that I live with a bunch of crazy people in Blacker Hovse. It’s kind of like a frat, I guess—just a lot nerdier.
Every year, we spend weeks building an elaborate party. This year’s was themed around Dr. Seuss and began at the edge of our lounge’s outdoor balcony, a couple dozen feet above the courtyard below.
In the air above it was the dance floor, spanning a multiple-level treehouse and colorful staircases which separated the heights.
My modest glass can only go so far in capturing the size of this construction, but at least I can show you some of the art, which covered basically every vertical surface at the party.
I’d like to introduce you to a superior olde-timey invention: the tempest prognosticator.
The prognosticator is essentially a very ornate leech-powered barometer created by George Merryweather in 1850.
Apparently, leeches become agitated as storms approach. The Doctor imprisoned a leech in each of twelve bottles; a whale-bone attached to a central bell is hung from the top. When the leeches climbed up the bottles, the bell would ring. The idea: if the bell rings incessantly, there’s probably a storm coming.
Supposedly, the prognosticator does actually work to some extent. But given that mercury barometers were invented in the seventeenth century, I’m not sure why the good Doctor bothered. I like to think it’s just a manifestation of the mad science archetype.
One more thing: as if this device’s name weren’t already wonderful enough, it was originally introduced as “An Atmospheric Electromagnetic Telegraph, conducted by Animal Instinct.”
I made a game for you with my friends Daniel and Chris. It looks like:
It’s fun, but it’s also for science. How, you ask?
First, we’re capturing players’ results (time and tags needed) to learn which movie tags are most useful.
Second, we’re trying to win a silly Googlebombing contest on the term “rankmaniac 2010,” and we figured that we’d do it by making some interesting content rather than by using dirty SEO tricks.
So if you like the game, thank us by linking to it. Because Caltech needs to beat Carnegie Mellon. We don’t have football; we have this.
This 1945 essay in The Atlantic Monthly is eerily prescient of the way the web works today, albeit via microfilm cameras and projectors.
Consider a future device for individual use, which is a sort of mechanized private file and library. It needs a name, and, to coin one at random, “memex” will do. A memex is a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility. It is an enlarged intimate supplement to his memory.
Vannevar Bush wrote this piece while director of the Office of Scientific Research and Development—the office which had just successfully completed the Manhattan Project.
Besides its proposal for the “memex” device itself, this essay riveted me because it so cleverly described a fundamental difference between books and our brains. On paper, information is necessarily linear: essentially, it’s an organized listing of facts. But your brain doesn’t store information that way. It’s associative.
That’s why we can find information on Wikipedia (and the web in general) so effectively: it’s organized more like our brains.
We used to play Motherboard Roulette, where we’d take five–second turns with a soldering iron trying to knock out a running computer. Of course, we’d agree on a few off-limit areas first. They used to last a few rounds! Man, they don’t make motherboards like they used to.