Slide 1

Slide 1 text

Logic Lessons That Last Generations Ian Dees • @undees Open Source Bridge 2012 This is the story of a book. To paraphrase Douglas Adams, it’s the story of “a wholly remarkable book.” A book that turned a writer from the 1960s into a time traveller, an old engineer into a teacher, and a young boy into an engineer. A book with lessons for all of us, should we choose to listen, about how we explain, how we document, and how we build a legacy, both individually and as a programming community.

Slide 2

Slide 2 text

The story of that wonderful, beautiful Thursday, (channeling Adams again) “the story of its extraordinary consequences, and the story of how those consequences are inextricably intertwined with this remarkable book begins very simply. It begins with a house.”

Slide 3

Slide 3 text

Before we get to that, do any of you have an important person in your lives who had a lot to do with your getting into technology? A parent, teacher, or friend? What memories do you have of your path to technology?

Slide 4

Slide 4 text

This my grandparents’ house in East Texas where my family would descend several times a year to ride horses, chase dogs around, and so on.

Slide 5

Slide 5 text

That’s me among all my cousins. One of my favorite things to do during these visits was watch my grandfather work in his garage laboratory.

Slide 6

Slide 6 text

By day, my grandfather was an engineer. By night, he restored and operated radios. To his friends, he was Pete.

Slide 7

Slide 7 text

To the FCC, he was W5YNI.

Slide 8

Slide 8 text

To me, he was Grampy. I don’t know why he put up with my hanging around in his lab. Perhaps he saw my interest in engineering even before I did.

Slide 9

Slide 9 text

flickr.com/photos/ilex/150588521 The building of things scratches an essential itch for engineers. It’s why they became engineers in the first place. —Michael Lopp The Twinge Rands continues: “When they were six, their Dad handed them two boards, a nail, and a hammer and they started whacking. BLAM BLAM BLAM. Even with the nail awkwardly bent in half, the wood was suddenly and magically bound together: a thing was built. At that moment, this junior engineer’s brain excreted a chemical that instantly convinced them of the disproportionate value of this construction. This is the best wood thing in the world because I built it. And then they looked up from their creation and pleaded, ‘Dad, I really need more nails.’”

Slide 10

Slide 10 text

One day, Grampy presented me with a plain black three-ring binder. It looked ancient. It had long-abandoned spider nests in the binding. It was dusty and greasy.

Slide 11

Slide 11 text

When I opened it, I saw yellowed pages bearing the words, “Binary Logic,” by William S. Bennett.

Slide 12

Slide 12 text

The next page confronted me with a simple definition...

Slide 13

Slide 13 text

...followed by a simple puzzle. I’m sure you know the answer to this question. But just for fun, let’s follow one of the incorrect answers.

Slide 14

Slide 14 text

The book sets us gently back on course,....

Slide 15

Slide 15 text

...and we eventually find the correct solution.

Slide 16

Slide 16 text

Immediately, we’re asked to apply what we’ve learned. Which circuit implements the AND gate we’ve just read about?

Slide 17

Slide 17 text

(drink if Markus mentioned any theorems) If Markus Roberts is in the audience, he will cite DeMorgan’s Theorem and point out that the answer depends on whether you count a lit light bulb as on or off.

Slide 18

Slide 18 text

What is this thing? The book continues in the same style from there. Let’s take a step back for a sec. What on earth is this thing?

Slide 19

Slide 19 text

The page footer gives us a clue. This was a series of columns that ran in Product Engineering magazine from 1962-3, and again in 1965.

Slide 20

Slide 20 text

flickr.com/photos/knowprose/5863873076 As near as I can tell, Product Engineering ran from the ‘40s to the ‘60s. It seemed to be kind of like Popular Mechanics for design engineers. Geek-speak meets “the flying car of tomorrow.”

Slide 21

Slide 21 text

This particular column on binary logic was basically a Choose Your Own Adventure book for grown-ups. The editor referred to it as a “teaching machine” or “scrambled book.”

Slide 22

Slide 22 text

flickr.com/photos/mpieracci/2273915342 Before we get too excited about the possibilities, observe that the phrase “teaching machine” reminds us of interfaces that use the customer as a peripheral. As we’ll see, this book demands much more active involvement than that.

Slide 23

Slide 23 text

1. Tailored to the reader 2. Immediate feedback Frank Hall, the editor of the magazine, cited research that the “scrambled book” teaching method lets diverse audiences gain the same skill set at their own pace, and that reinforcement and feedback are crucial parts of the process.

Slide 24

Slide 24 text

Inventing on Principle Bret Victor vimeo.com/36579366 This emphasis on rapid feedback reminds me of Bret Victor’s excellent talk “Inventing on Principle,” in which he builds extremely interactive user interfaces in the service of a larger point about having a life's mission.

Slide 25

Slide 25 text

First things we notice: Let’s go back and look at the puzzle we just solved, and see the way Bennett is already teaching us not just how to understand binary logic, but also how to teach. First, he starts with one easy achievement—an early success to hook the reader.

Slide 26

Slide 26 text

He leaves easy navigation markers: we always know where we came from and where to go if we get lost.

Slide 27

Slide 27 text

1.Rush to an early victory 2.Reward exploration So, these are the first two lessons from diving into this work: get your reader to an early success, and don’t punish them for veering off the path.

Slide 28

Slide 28 text

bit.ly/dreyfus-skill Dreyfus model of skill acquisition Incidentally, this notion of setting up early obstacles that are just the right difficulty level is related to the Dreyfus model cited by just about everyone these days.

Slide 29

Slide 29 text

1. Novice 2. Competence 3. Proficiency 4. Expertise 5. Mastery In this model, you adapt your teaching style to the audience. This implies that the tips we’re talking about today are not universal. Bennett’s audience was engineers who knew other disciplines, but were novices at binary logic.

Slide 30

Slide 30 text

The next thing the book does is present us with an analogy to familiar items.

Slide 31

Slide 31 text

Several analogies, in fact, drawing first from simple electrical and mechanical devices.

Slide 32

Slide 32 text

In one clever setup, the author even makes his hypothetical mechanical device physically resemble the old schematic symbol for an OR gate.

Slide 33

Slide 33 text

The devices get more elaborate; here’s another OR gate. Since this device is a series of tubes, it may be a mechanical precursor to the internet. ;-)

Slide 34

Slide 34 text

The book branches out into other engineering disciplines, even using optical elements in some examples.

Slide 35

Slide 35 text

1.Rush to an early victory 2.Reward exploration 3.Start where your reader is In other words, Bennett is meeting the reader on their terms.

Slide 36

Slide 36 text

More puzzles Let’s look through some more steps in the process.

Slide 37

Slide 37 text

After we’ve mastered the basics, Bennett introduces some humor. This went over my head at the time; I thought he was saying the measurements were intolerable!

Slide 38

Slide 38 text

YES +---------------+ NO /--------| Does It Work? |--------\ | +---------------+ | | | \ / \ / +-------------+ +----------+ | Don't Mess | YES | Did You | NO /---| With It | /----------| Mess |------\ | +-------------+ | | With It? | | | | +----------+ | | \ / | | /------------\ | | | You IDIOT! | \ / | \------------/ +-------------+ | +--------+ | YES | Will You | | NO | Does |<---------/ /------------| Pay For It? | | ----| Anyone | | +-------------+ | | | Know ? |--------------\ | | NO | | +--------+ YES | | \ / | | \ / \ / +-----------+ | | /---------------\ YES | Will You | | | /----->| You Poor Fool |<------| Be Fired? | | | /---------\ | \---------------/ +-----------+ | -->| Hide It | | | | NO | \---------/ | \ / | | | | NO +---------------+ \ / | | \------| Can You Blame | /----------\ | | | Someone Else? | | Trash It | | | +---------------+ \----------/ | \-------------\ | YES | | | | | | \ / \ / | | +-----------------------+ | \---------------------->| N O P R O B L E M !! |<--------/ +-----------------------+ anon. The schematic resembles that famous Usenet gag about a universal flowchart for diagnosing engineering problems.

Slide 39

Slide 39 text

1.Rush to an early victory 2.Reward exploration 3.Start where your reader is 4.Apply dirty tricks in moderation Going for the cheap laugh is of course fine; just do so in moderation.

Slide 40

Slide 40 text

Here, Bennett introduces what he says is a labor-saving device: algebraic notation for simplifying logic diagrams.

Slide 41

Slide 41 text

But it turns out it was just a backdoor way of preparing us for DeMorgan’s theorem...

Slide 42

Slide 42 text

...which basically says you can reverse the meanings of AND, OR, and NOT in a circuit and still get the same result. This is a huge deal in logic design; you can build an entire design out of one kind of component.

Slide 43

Slide 43 text

1.Rush to an early victory 2.Reward exploration 3.Start where your reader is 4.Apply dirty tricks in moderation 5.Use the head fake This teaching by misdirection was dubbed a “head fake” by Randy Pausch,...

Slide 44

Slide 44 text

The best way to teach somebody something is to have them think they’re learning something else. —Randy Pausch, The Last Lecture ...in his famous Last Lecture.

Slide 45

Slide 45 text

1 0 1 1 0 0 0 0 Next, Bennett has us putting building blocks together in bigger combinations. Consider this circuit that folds in on itself.

Slide 46

Slide 46 text

1 0 1 1 0 0 0 1 As you toggle one of the inputs at the bottom,...

Slide 47

Slide 47 text

0 0 1 0 0 1 1 1 ...both outputs at the top change state and stay in their new configuration.

Slide 48

Slide 48 text

Flip-flop This kind of circuit is known as a flip-flop. It’s the foundation of electronic memory.

Slide 49

Slide 49 text

Memory If you don’t want the inconvenience of two inputs, you can combine them into a single “toggle” input.

Slide 50

Slide 50 text

Comparator Once you have one-bit memory cells, you can assemble them into four-bit numbers and compare them.

Slide 51

Slide 51 text

Counter You can also chain them one to the next, building a circuit that can count numbers.

Slide 52

Slide 52 text

These are the parts of a computer flickr.com/photos/fimbrethil/137042644 These are the building blocks of a computer! By the end of the course, you’ve essentially seen the most important pieces of a CPU.

Slide 53

Slide 53 text

1.Rush to an early victory 2.Reward exploration 3.Start where your reader is 4.Apply dirty tricks in moderation 5.Use the head fake 6.Forge something of value Bennett has brought us from “this is an AND” to “go design your own computer.” He has given us the power to create value.

Slide 54

Slide 54 text

Then, just to drive the point home, he spends another advanced lesson showing us more analogies. Here’s a flip-flop made of pulleys.

Slide 55

Slide 55 text

Here’s another flip-flop; this one’s made of moving air! The research to create thin sandwiches of transparent material was new at the time. Bennett was using his column to give us sneak peeks at emerging technologies.

Slide 56

Slide 56 text

Here’s a NOR gate made of moving fluid...

Slide 57

Slide 57 text

...and an AND gate. He has deliberately chosen these layouts...

Slide 58

Slide 58 text

...to prepare us for the actual implementation of the logic gates in silicon.

Slide 59

Slide 59 text

1.Rush to an early victory 2.Reward exploration 3.Start where your reader is 4.Apply dirty tricks in moderation 5.Use the head fake 6.Forge something of value 7.Build bridges to other worlds These analogies started out as a warm, fuzzy way to introduce the core teaching concepts, and now they’re being used to go the opposite direction: to branch out into new territories.

Slide 60

Slide 60 text

Final exam The last part of Bennett’s course is the final exam.

Slide 61

Slide 61 text

If you send in your correct answers and 50 cents handling, you get your very own diploma.

Slide 62

Slide 62 text

flickr.com/photos/adafruit/3335282022 Achievement unlocked! Remind you of anything?

Slide 63

Slide 63 text

We talk a good (ahem) game about gamification these days, but Bennett beat us to the punch by about 40 years.

Slide 64

Slide 64 text

Tricked into designing a computer By engaging us in this quest, Bennett has basically tricked us into designing a computer. We’ve fought our way through obstacle after obstacle, including a final boss.

Slide 65

Slide 65 text

1.Rush to an early victory 2.Reward exploration 3.Start where your reader is 4.Apply dirty tricks in moderation 5.Use the head fake 6.Forge something of value 7.Build bridges to other worlds 8.Support the hero’s quest This whole journey through the book, culminating in slaying the final dragon and collecting riches, supports the idea of the reader as a hero.

Slide 66

Slide 66 text

A good technical book has a narrative flow. In many of our books, we try to make it explicit, starting the books with a story showing the reader as hero. —Dave Thomas, So You Want To Be A Writer The Pragmatic Programmers talk about this a lot. In fact, the Author’s Guide they distribute to everyone who writes for them contains a whole chapter on the idea.

Slide 67

Slide 67 text

My open questions: As we move into the final phase of this talk, I’d like to talk about a couple of the many questions I’ve asked about Bennett’s remarkable book.

Slide 68

Slide 68 text

How do we preserve Bennett’s legacy? First, as delightful as it is that this book is still engaging and relevant, how to we preserve it?

Slide 69

Slide 69 text

How do we preserve any legacy? Indeed, how do we preserve anything?

Slide 70

Slide 70 text

One answer is translating into other media. McGraw Hill did republish the work in paperback form in the ‘70s. I’ve written them to ask permission to go further, and translate the work into hypertext.

Slide 71

Slide 71 text

>KILL TROLL WITH FLIP-FLOP YOU CAN'T SEE ANY FLIP-FLOP HERE! Perhaps an even better venue would be an interactive story; for more on how to build those, see Bart’s talk on Thursday at 10:00.

Slide 72

Slide 72 text

Oral cultures are not just, or even primarily, about quality assurance in transmission. They are primarily about quality assurance in composition, and training in the basic moves of exposition and condensation. —Venkatesh Rao The thing about casting things as stories like this is that they have as big of a beneficial impact on the storyteller and the material itself as they do on the listener.

Slide 73

Slide 73 text

How did he do it? The other big question is, how did Bennett manage to create this enduring work in the first place? Did he even know how significant his creation would be?

Slide 74

Slide 74 text

1.Rush to an early victory 2.Reward exploration 3.Start where your reader is 4.Apply dirty tricks in moderation 5.Use the head fake 6.Forge something of value 7.Build bridges to other worlds 8.Support the hero’s quest That brings us back around to the lessons we’ve gleaned from looking at this work.

Slide 75

Slide 75 text

Speaking of the hero’s journey, here’s a eulogy written by one of my Grampy’s fans. I found it among the family photos I was scouring for material for this talk.

Slide 76

Slide 76 text

In particular, see how Grampy taught more people than just me. His passion for engineering is still rippling throughout the universe.

Slide 77

Slide 77 text

I don’t think Grampy was worried about trying to preserve his legacy. I think he was just doing what he loved, and encouraging others to do the same.

Slide 78

Slide 78 text

This means we don’t have to sweat this, either. Any one in this room could build something that people are still talking about generations from now. Any one of you could teach one person a skill and see that knowledge spread to thousands. I am standing in a room full of conquerors and heroes, with any luck I’ll be around long enough to see the impact of your deeds far and wide. Cheers.