Programming and mathematics

By May 14, 2016 No Comments

The large number of job opportunities in the tech industry has caused many people to wonder whether programming requires knowledge of mathematics. The answer, of course, depends on the industry in question; there is no reasonable way to answer such a query without first being clear about what type of programming we’re discussing. The same can be said of mathematics. It’s quite easy for some to make claims related to mathematics as a whole, but it turns out that arithmetic is not calculus . . . and calculus is not set theory. Given the fact that I am a web developer (and indeed, quite new to the industry), and given that I haven’t taken a single course in mathematics beyond calculus, I will rephrase the question like this: “Does web development require knowledge of advanced mathematics?”

The short answer is NO. A more complete answer, at least from my fairly limited perspective, is this: a career in web development will typically require only limited use of basic arithmetic, but an understanding of more general mathematical concepts might give you a decent advantage. I suspect that the motivating force behind this question is related to the widespread intuition that mathematics is difficult (or at least outrageously boring). Even if we were to somehow purge all of mathematics from the act of creating a program, we would be left with a great deal of non-mathematical concepts—concepts related to logic and concepts unique to programming—that can be fairly difficult to grasp.

I don’t intend to embark on an advanced study of the relationship between mathematics, logic, and programming. That would be outrageous and boring and our brains would explode and you’d get all mad at me and stuff. My tentative opinion here is that programming—in practice—relies more on logic than it does on arithmetic. But I’m not sure how I feel about this. A number of philosophers and mathematicians have attempted to reduce all of mathematics to logic. This exactly didn’t pan out the way they expected. Maybe it’s impossible. Maybe these guys just got lazy. I don’t know how this baloney works, but apparently we CAN reduce arithmetic to logic. If this is true, if arithmetic simply is logic, then we probably need to rephrase the question yet again.

It’s obvious that all three disciplines, however interconnected or dissimilar they truly are, rely on shared concepts. The notion of truth-functional connectives and Boolean values allegedly appear in first-order logic and programming, but not in mathematics. But then there’s Boolean algebra. And then you wonder what set theory even is, and what kind of wrench those guys are preparing to throw into your pretty, little theory. Operator scope and well-formed formulas (or “valid syntax”), on the other hand, are applicable to all three domains. Type coercion and object orientation appear to apply only to programming. To confuse the issue even more severely, there are examples of shared terminology used to communicate different concepts. The terms “argument” and “conditional statement” are deployed rather frequently in formal logic and programming, but in different ways. And then there’s a function in mathematics and a function in JavaScript. Are these really the same type of thing? Does it matter?

Probably not.

Recall that we started with a question. We then attempted to clarify that question but got stuck in some kind of theoretical swampiness and started losing our grasp on the original problem. Right now we’re climbing out of that nonsense and I am encouraging the adoption of a practical solution: since first-hand experience appears to be the most reliable way to gauge interest level in and the perceived difficulty of some activity, we ought to stop entertaining ourselves with an endless train of questions. Instead, we should take chances and try things—even things that appear to be too hard. Find a tutorial. Pick up a book. In my opinion, autonomous effort and experimentation beats theorizing and advice every time. Even if you end up hating programming, perhaps you’ll learn something.

Good luck and happy computing!

Leave a Reply