Mr. Miyagi Teaches Coding

Mr. Miyagi Teaches Coding

Doug Bradbury

May 13, 2015

I sat down last night to watch the ’80s movie classic, "The Karate Kid." In addition to being overwhelmed with nostalgia for my childhood, I was reminded of how formative this movie really was for me and how much of what we do in terms of mentorship and apprenticeship at 8th Light has echoes in this film.

Mentorship is a pact

When Mr. Miyagi agrees to take on Daniel, they swear a pact together.

We make sacred pact. I promise teach karate to you, you promise learn. I say, you do, no questions.

Every mentor-apprentice relationship is a mutual promise. It won’t work without commitment and investment from both sides. This is why, at 8th Light, each Craftsman decides for her- or himself when taking on an apprentice. They aren't assigned or compelled. A mentor agrees to take on a student because they choose to do so.

Paint the fence

Daniel’s training begins with a series of home improvement projects at Mr. Miyagi’s house. First he washes and waxes a half dozen classic cars, then sands the floor, paints the fence, and finally paints the house. The four days of labor culminate in this incredible scene where Miyagi turns Daniel’s repetitive home improvement movements into defensive karate moves. Practice doesn’t always feel like practice, but it is always intentional. I sometimes have apprentices wonder why they need to build Tic Tac Toe for the umpteenth time? It’s not because it’s a hard problem, it’s because it’s simple once it’s understood it becomes a great car/deck/fence/house to practice technique on.

Photo courtesy Columbia Pictures


While it may have first been master Yoda who expressed that there is no “try,” Mr. Miyagi brings his own spin on “Yes” and “No”:

Walk on road, hm? Walk left side, safe. Walk right side, safe. Walk middle, sooner or later get squish just like grape. Here, karate, same thing. Either you karate do "yes" or karate do "no." You karate do "guess so,” [makes squish gesture] just like grape.

One of the most important lessons learned by 8th Light apprentices is to commit and follow through on what you say you will do. They also learn to say no when a request is not possible.


In a rocking fishing boat, in the crashing waves on a beach, and on the crane technique stump, Daniel learns from Miyagi about balance.

Better learn balance. Balance is key. Balance good, karate good. Everything good. Balance bad, better pack up, go home. Understand? Lesson not just karate only. Lesson for whole life. Whole life have a balance. Everything be better. Understand?

It’s easy for a young programmer to become myopically focused on code at the expense of everything else. While the programming culture tends to overvalue this kind of focus, we recognize that by bringing people into programming with a variety of backgrounds and interests, we actually build better code because we’ve learned from experiences and disciplines outside of coding. We also learn that oftentimes the best thing we can do when stuck on a problem is to walk away from it for a moment to gain some perspective.

Quality over Quantity

Daniel is seriously outmatched in terms of the number of moves he has learned when he faces Johnny in the finals. While his opponents perform elaborate spin kicks, Daniel has only simple defense and a quality punch. Mr Miyagi reassures him:

You trust the quality of what you know, not quantity.

We know that in a software apprenticeship it is impossible to learn everything you need to know to do the job. We don’t try to teach every technology, pattern, or technique. Instead we focus on the process of learning itself. We know that an 8th Light apprentice will be able to learn whatever the next project needs quickly and effectively because they have been well grounded in the fundamentals of good software.


Wax on, right hand. Wax off, left hand. Wax on, wax off. Breathe in through nose, out the mouth. Wax on, wax off. Don’t forget to breathe, very important.

When trying to solve some problems, we can get very worked up. Fighting a bug or an error or a broken development process or a production crisis can overload our senses, shutting down our critical-thinking and problem-solving skills. It’s at these moments that we need to remember to breathe. Stop debugging, push back from the keyboard, and take five long breaths. Your current crises will look different when you return.