The power of mishtakes

By David Griffiths
December 18, 2008 | Comments: 1

Next year is the 30th anniversary of The Book of Heroic Failures by Stephen Pile. It's like the Guinness Book of World Records for the clumsy, the forgetful and the just plain confused.

  • Like the civil servant from Andorra who forgot to attend the peace treaty signing in 1919, resulting in Andorra being the only country in history to have taken part in two World Wars at the same time.
  • Or Douglas Corrigan, who intended to make an historic flight from New York to California, but because of a navigational error landed in Ireland.

Throughout human history, failure has been our constant companion. No matter how hard people try, no matter how many systems and backup systems and backup-backup systems we put in place, stuff still goes wrong.

mishtakes.png

Now if you are running a Nuclear Power Station, or a hospital, or a government department then failure is a bad thing and a lot of your time is probably spent in finding ways of preventing it.

But the truth is that at Head First we don't see mistakes as always a bad thing. In fact we kind of like failure.

And it's all to do with the way that your brain works. Read more...

Livin' like a lizard, baby

At the base of your brain is a region called the Reptilian Complex. It's the legacy lizard brain that you inherited from millions of years of evolution. Think of it as a BIOS chip: it handles a lot of the really low-level stuff that you are not consciously aware of. It takes care of you. It tells you when to fight and when to run. When to eat and when to drink. It remembers which things are good for you and which are bad.

But what's really interesting is how your lizard brain remembers. Unlike a computer, it doesn't just store facts away like files in a cabinet. It remembers things by association.

Imagine you ate some berries and a few hours later felt sick. Your lizard brain would associate those two events. The next time you even see the berries, your brain will reactivate the association and you start to feel queasy.

So your brain can associate things with mistakes and failures really easily. It needs to keep track of the bad stuff because that's what's likely to harm you. And that's why we think failure can be a really great thing.

Because if we can associate a piece of learning with some sort of failure, then you'll remember it.

Getting Rails into your head

Take Head First Rails for example. Half, maybe two thirds of the code is designed to be incomplete, or buggy, or to crash. Why is that?

Because it's memorable. For example, Rails uses routes to work out which piece of code should be run when a request is received from a web browser. Routes are kind of fiddly but thankfully most of the time Rails generates them for you so you don't really need to understand how they work.

Most of the time.

But Rails routes have a number of intricate little rules associated with them. The order in which they are written matters. The type of HTTP method (GET, POST etc.) matters. And if you get a problem with the routes in your application then all kinds of weird things can happen.

Now there are really three ways of dealing with routes from a teaching point of view.

The first way is to just ignore the problem. Just use the generated routes. Avoid any situations that are likely to cause difficulties. Replace that part of the book with some reference material on 15 different ways of formatting text. That would probably feel very good. You'd read the book and learn how to do a few cool things, but a few months down the line when you inherit somebody else's broken code, you'd probably feel completely lost.

The second way is to simply write down the rules. Just tell people. Say "The order of the rules matters and the matching algorithm takes into account the HTTP method verb contained in the request".

The problem with that approach is that people probably won't remember it. Heck, they probably won't even read it. I just wrote the sentence and I nearly fell asleep half way through.

So what's the Head First approach? Well we don't just avoid the issue. And we don't just tell you the rules. Instead we show you how the rules work.

How do we do that? We use mistakes. And failure. We give you code that breaks the rules. And then we ask you why you think it happened. We take you through that sense of failure because then — if you come across a similar gnarly problem in the Real World your brain will contain the association between the failure and the solution.

It's a tough old 21st Century World out there. And you need to make the most of your ancient cretaceous brain to live in it.


Comments: 1

Congrats Dave on getting the book published - I look forward to reading it & nitpicking (in a supportive way, obviously).

Eddie

PS - this is for publication!

Leave a comment



RSS Feed

Twitter

Facebook


Looking for source files, code, exercise answers, and other materials to go along with your Head First book? Go to this page, find your book on the list, and click on the title.

Get The Latest Head First Tweets!

Get the latest Head First books here!

Head First Algebra Cover Head First PHP & MySQL Cover
Head First Rails Cover Head First Web Design Cover

Head First Algebra, Head First PHP & MySQL, Head First Rails, and Head First Web Design are now available.

Buy 2 Books, Get the 3rd FREE! Use the discount code OPC10 when you buy direct from O'Reilly.