Weird 19th-century squiggles (why don’t programmers learn math?)

Every so often the “should programmers learn math?” question comes up in hubs on the internet. Today, as often, it’s on HackerNews. The discussion is usually the same:

Programmer: What are these weird 19th-century squiggles that I can’t find on my keyboard, and why don’t you just write a compiler for math?

Mathematician: Writing a compiler for 2k years of legacy code with rapidly evolving standards would be waste of time and probably not useful to anyone. It’s also not even clear what “compiler for math” means when anyone is free to invent their own notation and assign it arbitrary semantic meaning. And you’re telling me that it wasn’t a completely arbitrary decision to put { } and ` on a keyboard but not find space for ∞ and ∩? You use emacs/vim and have 3–4 kinds of key modifiers, and you’re telling me you can’t just write a plugin for these symbols? We certainly did a fine job incorporating ~2k emojis into everyday user interfaces.

Programmer: Math notation is like C++, but with 50 times more cruft. It’s optimized for old dead white men who know Latin and write on paper. It’s not optimized for use with a computer.

Mathematician: Who is arguing that math should be done on a computer? It’s a language for humans (mostly in English, not Latin). In order for your argument to be consistent, you must also argue that English is broken because it’s been optimized for writing and speaking, not for use with a computer. In fact, everything that’s not programming is broken because it’s not optimized for use with a computer! Maybe instead you should learn math sans keyboard, or make computers better as an interface for learning math (note the emphasis on the computer being the tool, not the master). But if you did learn math, you would find that it enables you to write awesome programs and understand why they work. If your argument is that math is just too foreign and scary and cumbersome to tear yourself away from a compiler catching your typos and type errors, then I am sorry. Please continue to enjoy your self-imposed intellectual limitations, and let’s hope they never figure out how to automate writing CRUD apps.

Programmer: Systems programmers have spent so many years thinking about how to design abstract logical systems that are easy for humans to use, mathematicians should take a hint!

Mathematician: Mathematicians have been designing abstract logical systems for thousands of years. It might not be perfect, but it’s certainly stood the test of time. And, for what it’s worth, programmers take for granted the parts of mathematics they understand well, and cry wolf about anything new. Coordinate geometry, graphs and plots, functions, these are all mathematical inventions.

Programmer: It takes a lot of work to come up with a CS aesthetic, and when you have one, your brain only has room for “good” systems that play by your rules.

Mathematician: That’s just…not true. The fact that you can deal with normal human language disproves your claim.

Programmer: But you still have the reality that programmers are dead scared of math!

Mathematician: You’ve got me there.

Personally, I think that if mathematics were introduced to most programmers at the same age and with the same style as programming, this would be a non-issue. The problem is that educators of young people are even more terrified of math and math notation than programmers are! They don’t know what resources to direct interested kids to, or how to foster a “native fluency” in math beyond the basic mechanics of algebra. (I was one of those kids)

As far as your brain is concerned, think of mathematics as closer to language than programming. Mathematics is the language used between humans when they want to transfer a concept about mathematical objects (numbers, functions, graphs) from one brain to another. That’s what it’s optimized for. No English speaker would try to learn German and then reasonably complain that the sentence structure isn’t more like Python, or that German words don’t have clear enough meaning to a non-German speaker! Don’t impose an unreasonable expectation on math, which like German is more compact and expressive than a programming language by necessity. Math needs to be more expressive than a programming language because it needs to express a the same variety of concepts and still fit in a human conversation, as opposed to a thousand-line source file.

And as you learn more math, you build upon the previous math. If you’re learning to read and you see the word “Dickensian,” but you’re at the “See Spot Run” reading level. Of course you’re not going to be able to pronounce the word, nor would you even begin to understand its semantic meaning, which refers to a quality of specific books you can’t read! All of this implies that language is indeed hard, in part because it’s just hard, and in part because there’s a big cultural history behind many words. But it’s definitely not evidence against English as a useful tool.

I’m not saying math is perfect, and I’m not saying the way mathematicians write about math to a general audience is perfect. Those are indeed different issues, and I do seriously hate the way most “introductory” textbooks read! But math is not the enemy here. The excuses that get brought up again and again are red herrings to avoid admitting, “math is hard and I don’t have the time to learn it, nor do I need it enough to justify gaining and maintaining fair fluency.” There are obviously ways math educators and writers could make it easier for students to learn, but it honestly wouldn’t make math all that much easier. It’s an inherently hard subject. If you want to learn it, get used to going very slow and checking yourself at every step.