How much math do you need to write code?
Nov. 22nd, 2011 04:44 pmI got a really interesting query today that boiled down to, "How much math do you need to write code?"
The short answer to this is, "Not that much" or perhaps "it depends on what you want the code to do." But here's part of what I actually wrote back:
---
To be honest, the level of math required to write code is pretty small. A grade school understanding is often sufficient; there's a reason we can teach 7 year olds to program! Modern programming languages are much less math-oriented: I once spent an afternoon teaching my then 11 year old sister and her friends how to write dynamic database-driven websites, and the only math they used was to add up the scores on the "what animal are you most like?" quizzes they wanted to write.
The math in computer science comes a lot later: for deeper analysis of algorithms and running time, we use algebra and mathematical proofs in an academic setting. But... to tell the truth, relatively few programmers need or use this kind of deeper understanding in their day-to-day jobs. And in my experience teaching students, many people find this stuff easier to learn by doing, so they only really begin to grasp it *after* they have gotten comfortable writing programs.
In short: you probably have all the math skills you need to write code, and if you decide you want to do more hardcore CS later, it'll be easier to learn the math along the way anyhow!
---
There's some nuance there that I didn't really tease out -- the deeper understanding of algorithms and program behaviour is what characterizes the real "science" out of computer science. And maybe the world would be a better place if more programmers did actually use deeper analysis in their day-to-day jobs. But you don't have to be an academic-style computer scientist to write code! Still, it's a very interesting question, given that historically programming actually did require a lot more math, and our perceptions and stereotypes haven't really kept up with the reality of the field.
Perhaps it's time for me to write another presentation? ;)
(For context: my old slideshow about women, computing and math got included in this TechCrunch post about Racism and Meritocracy, so I've been getting a lot of mail, including the one that spawned this post.)
The short answer to this is, "Not that much" or perhaps "it depends on what you want the code to do." But here's part of what I actually wrote back:
---
To be honest, the level of math required to write code is pretty small. A grade school understanding is often sufficient; there's a reason we can teach 7 year olds to program! Modern programming languages are much less math-oriented: I once spent an afternoon teaching my then 11 year old sister and her friends how to write dynamic database-driven websites, and the only math they used was to add up the scores on the "what animal are you most like?" quizzes they wanted to write.
The math in computer science comes a lot later: for deeper analysis of algorithms and running time, we use algebra and mathematical proofs in an academic setting. But... to tell the truth, relatively few programmers need or use this kind of deeper understanding in their day-to-day jobs. And in my experience teaching students, many people find this stuff easier to learn by doing, so they only really begin to grasp it *after* they have gotten comfortable writing programs.
In short: you probably have all the math skills you need to write code, and if you decide you want to do more hardcore CS later, it'll be easier to learn the math along the way anyhow!
---
There's some nuance there that I didn't really tease out -- the deeper understanding of algorithms and program behaviour is what characterizes the real "science" out of computer science. And maybe the world would be a better place if more programmers did actually use deeper analysis in their day-to-day jobs. But you don't have to be an academic-style computer scientist to write code! Still, it's a very interesting question, given that historically programming actually did require a lot more math, and our perceptions and stereotypes haven't really kept up with the reality of the field.
Perhaps it's time for me to write another presentation? ;)
(For context: my old slideshow about women, computing and math got included in this TechCrunch post about Racism and Meritocracy, so I've been getting a lot of mail, including the one that spawned this post.)