Wednesday, March 29, 2017

Don’t Skip the Code

By Nathan Carter

I’ll just say it right out. You should learn to program.

Like, really learn it. At least a computer science minor, maybe more.

You’ve probably heard “coding is the new literacy” a thousand times. I’m not going to say that. My reason is different.

Are you expecting to hear about marketability and median starting salary for graduates who combine math and computer science? Sure, data science is hot, and you can make good money ( But that argument is convincing only if making money is your goal. “I like topology!” you say. “Keep your stupid money!” Don’t worry—I’m not going to talk about your marketability.

So what is my reason? Is it those mathematicians who leverage computers in their research? The Borwein brothers are well known for their contributions to number theory from a computational approach. William Stein is at least as well known for creating the mathematical software package Sage as for his number theoretic uses of it. The four-color theorem was proven by a computer . . . sort of.

You’re getting warmer. After all, the first research team I joined after graduate school had me writing R code to analyze graphs. But no, that wasn’t my argument either; not every area of mathematical research needs computers.

Nor was I planning to use a close cousin of that argument, for educators. Programming gives math teachers the ability to create great interactive experiences like those on, the Wolfram Demonstrations Project, and Great resources, but they’re not my reason why you should learn to program.

Give up yet? Okay, I’ll tell you.

You should learn to program because mathematics and computer science have an amazing synergy that will open up your brain.

No, not like head trauma. Like enlightenment.

Both mathematical language and programming languages are ways of making ideas precise. They reinforce one another, like weight training and sports. To learn to program well (not just quick and dirty coding but real programming) requires pervasive organization in your thinking. That organization transfers to how you think and communicate about everything, especially precise things like mathematics.

Heck, programming requires even more organization and precision than mathematics does! I’ll back that up with a quote from Deb Roy, a roboticist at MIT, who said, “To understand how something works, you need to build it.” I can’t tell you how many times I’ve found that to be true.

I didn’t understand the change of basis matrices in an abstract algebra course until I needed them in a C++ library I was writing for computer graphics. My computer has been more exacting on my handling of edge cases than any journal referee. Just this morning I learned that I didn’t fully understand a graph algorithm when I tried to implement it in a new context. In each case, my understanding had to improve because I wasn’t just doing math, but building it. There’s a stereotype that the hardcore geeks skip computer science to get to math. Don’t believe stereotypes.

I promised not to call coding the new literacy. It’s a common phrase, but I prefer the idea that modeling is actually the new literacy (

Don’t run away, pure mathematicians! Yes, modeling happens in stats and applied math. But any time we turn ideas into a precise formulation we can explore, we’re modeling. Taking an idea you have in set theory, formulating it as a new axiom, and exploring its consequences with theorems is modeling too.

Mathematicians and computer scientists both model for a living. (Ha.) Learning to program will expand the ways in which your brain does modeling. That will make you better at it, in code and in math. That’s my real argument. You get a more awesome brain. It’s probably not too late to change your schedule for next semester.

Nathan Carter programs and does math. He teaches at Bentley University and has written two books for the MAA, Visual Group Theory (2009) and Introduction to the Mathematics of Computer Graphics (2016).