Lessons in Teaching Code

Here at Moonshot, not only are we tasked with thinking about and preparing for the challenges and opportunities we’ll encounter in the future, but also with teaching the skills we believe will be instrumental in meeting those challenges and taking advantage of those opportunities. Chief among these skills is computer programming; we believe learning about code (what it is, how it works, and how to use it) can benefit anyone, at any age.

Those who learn to code also learn to think more deeply about the problems they face. They are empowered to build their own ideas and solve their own problems in novel and interesting ways. Programming can certainly make a great career for those interested in diving deep, but it also can provide a fruitful return to those willing to invest even a few hours into deepening their understanding.

In the past year or so, our teaching has taken many different forms and we’ve been able to work with people of all different ages and backgrounds. Recently we’ve:

  • Led local user groups of professionals who were learning new languages;
  • Facilitated creative coding workshops at Barkley, where employees with no technical background create generative art with Processing;
  • Taught an introduction to Arduino, a primer on physical computing and the IoT (internet of things);
  • Volunteered at CoderDojo, a weekend program which teaches young people to code;

Take Your Kid to Work Day

Richard Feynman famously said “If you can’t explain something to a first year student, then you haven’t really understood it.” We recently had the opportunity to put our understanding to the test: for Barkley’s annual Take Your Kid to Work Day, we invited 25 children to the lab for an innovation hour. The kids learned the basics of coding and wrote their very first programs. We also introduced Scratch to the older kids, who by the end of our time together were making creations of their own. After that, we pulled out the VR headsets, followed by some dancing in front of our Remix Booth!

If you can’t explain something to a first year student, then you haven’t really understood it.

Lessons Learned

When working with someone new to programming, our goal is to get them to learn beyond whatever instruction we’re providing. Becoming a competent developer is a long journey and the world of code is vast, but there’s a surplus of (free!) learning resources available on the internet. The trick is to instill a sense of confidence in the learner; anyone can learn to code, but it takes perseverance and a willingness to seek out answers to one’s own problems. To help inspire self-learning, we’ve come up with a few principles:

1. Results First

Too frequently, those who code overemphasize the importance of programming fundamentals when teaching novices. Although important for long term growth, fundamentals are not exciting.

People are much more eager to learn if they’re inspired. Helping a student quickly create something they previously thought impossible will spark curiosity and motivate them to learn more. It doesn’t matter that whatever piece of code they wrote won’t scale, has 42 dependencies, and is terribly formatted. The important first outcome is someone saying “I made that.”

2. Help Them Solve Their Own Problems

It may seem obvious to some, but knowing how to effectively use a search engine is a crucial skill in the process of learning how to program. It’s not practical to memorize the syntax of an entire programming language, so being able to Google well becomes imminently useful. When teaching, we never take over the keyboard from a student; rather, we give them ideas for things to search for. This technique, which we learned from CoderDojo, helps instill confidence in the learners and teaches them to solve problems for themselves.

We also focus on thoroughly understanding an issue before attempting to solve it with code. Breaking up what may seem like an insurmountable problem into small chunks not only makes for cleaner and more maintainable code, but also helps a beginner think through all the logical steps involved in making something happen.

3. Demo

Providing a platform to show off work is important, especially for kids. It gives everyone an opportunity to demonstrate their creativity, build confidence, and learn from each other. For web code, we particularly like using CodePen, which provides a simple interface in which to create, share, and remix creative projects.

Like teaching any new skill, teaching programming take patience and a willingness to work with students in whatever way they learn best. We’ve found lessons that are bite-sized, iterative, fun, and allow for individual creativity tend to be the most successful. The world of code is vast and is only expanding, so strictly focusing on the particulars of any given language is fated to be a futile effort. Ultimately, what’s most important is teaching a student how to teach herself.

Thanks for reading! Check out more here.