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.)
no subject
Date: November 23rd, 2011 01:58 am (UTC)http://compscigail.blogspot.com/2011/11/event-idea-truth-about-women-in-science.html
I think I said more or less the same things, though the question was a bit different.
no subject
Date: November 24th, 2011 02:16 am (UTC)The more frustrating is the comments on slideshare, many of which focus on the BUT IT'S NOT PERFECT or BUT YOU DIDN'T ANSWER MY QUESTION and miss that maybe a humourous presentation isn't really the bestest science ever and never was intended to be. I'm highly amused by being able to keep going "You're right! this isn't science! That's ok!" but I feel like every time someone demands answers from me, a sociologist who's made this research his or her life work and is crying somewhere.
no subject
Date: November 23rd, 2011 11:54 am (UTC)However, to become a proper software developer, knowing a little about each kind of math helps a lot. You have to know just enough math to be able to teach yourself enough to design, modify, and implement algorithms. These might not even be driven by software, the last time I used significant math was to figure out how to get people to pay for a piece of software. That required a bit of high-school statistics to figure out if our test results were significant.
no subject
Date: November 23rd, 2011 03:25 pm (UTC)Most of the math we use is Symbolic Logic and a few integers; outside of graphics or an application domain you're unlikely to touch a real number or trigonometry or other "real" math.
no subject
Date: November 23rd, 2011 03:50 pm (UTC)I started out wanting to be a game programmer, but I ended up getting my degree in generic applications development simply because I discovered I would likely have to move out of state (at the time) to get a job, and that wasn't something I wanted to do. Most of what I did at my previous job was billing software which required I knew very basic algebra for some things, but for most things simple math was enough. The most complicated thing I ever had to write was a mini file-based database system for a handheld solid state computer in C, from scratch. The extent of my math is college trig & algebra plus high-school pre-calculus, which was very helpful in making lookups efficient.
I'm wishing now I stuck with game programming just to get the math background, and I'm actually looking at taking additional math classes again to refresh my skills.
no subject
Date: November 24th, 2011 11:09 pm (UTC)