Los mensajes de error, tus mejores amigos

The terminal can be impressive and frightening to people who haven’t seen it before. More than any other programming tool, working with the terminal looks like hacking. “That looks scary,” people will say when they look over your shoulder at terminal. “Like The Matrix. I couldn’t do that.”

Implicit in those statements is the idea that programmers have mastered an arcane art, that deciphering code requires special ability. But the truth is that terminal output is mostly English: bad, clunky English produced by a cranky machine. And the mark of a coder is stubbornness, not epiphany or ability. A programmer is someone who sees an ugly-looking error message, believes that she or he has the power to resolve it, and keeps trying new things until the error goes away.

Error messages contain clues, helpfully pointing out what’s gone wrong and which lines of code need fixing. But the ugliness of error output in the terminal can be off-putting, scaring off a new coder before he or she has a chance to learn from it.

That’s why my very first talk about programming, a lightning talk at RailsGirls Chile, was about error messages. Below are the slides in Spanish and English. Hat tip to Jeff Cohen at The Starter League, my first programming teacher, for introducing his students to the idea of error-driven development from the start.

Giving the talk got me wondering about ways to make the programmer’s toolbox less intimidating for new coders. What if terminal errors returned only the first line of an error up front, with the rest available by scrolling? What are other ways we could redesign programming tools to inspire confidence in first-time coders?