# Do computer programmers need to be good at math?

**URL:** https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283
**Category:** Factual Questions
**Created:** [November 23, 2004, 3:13pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283 "2004-11-23T15:13:57Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![ambushed](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@ambushed](https://boards.straightdope.com/u/ambushed)
#### Post date: [November 24, 2004, 10:26am UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/41 "2004-11-24T10:26:32Z")

</div>

I’ve known several first-rate programmers who have little or no facility with mathematics. Their high competence comes from their facility with language and their skill with linguistic (i.e., non-symbolic) logic. I am a systems programmer, and never have I needed to employ any non-trivial mathematics in my work.

Naturally, though, you don’t want such a programmer to write things like mathematical functions and other math-dependent code. For example, such a programmer is unlikely to be good at graphics programming or simulations.

Still, math skills are unnecessary for many programmers, and it must be said that, in my experience, programmers whose skill set is primarily mathematical _tend_ to write less readable, less maintainable code.

---

<div class="post-metadata">

### Author: ![CandidGamera](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/candidgamera/32/2878_2.png) [@CandidGamera](https://boards.straightdope.com/u/CandidGamera)
#### Post date: [November 24, 2004, 1:27pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/42 "2004-11-24T13:27:56Z")

</div>

> [@Mathochist](#):
>
> [hijack severity=“slight”]  
> Programmers here have now mentioned set theory three times. I have yet to see a computer science degree which required a real class in set theory.
> 
> Just what do you people think constitutes set theory anyway?  
> [/hijack]

Unions. Intersects. Lists of comma-separated numbers. Y’know, “New Math”.

---

<div class="post-metadata">

### Author: ![Small\_Clanger](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Small\_Clanger](https://boards.straightdope.com/u/Small_Clanger)
#### Post date: [November 24, 2004, 2:09pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/43 "2004-11-24T14:09:31Z")

</div>

> [@CandidGamera](#):
>
> “New Math”.

Base 8: Just like base 10. . .

If you’re missing two fingers.  
Tom Lehrer, mathematician.

---

<div class="post-metadata">

### Author: ![Futile\_Gesture](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@Futile\_Gesture](https://boards.straightdope.com/u/Futile_Gesture)
#### Post date: [November 24, 2004, 2:25pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/44 "2004-11-24T14:25:28Z")

</div>

I’m an excellent programmer (IMHO 🙂 ) and my mathematical skills are very average and I have no love of numbers at all.

I have to agree with nearly everything **ftg** said. The key skill is the ability to abstract. In my experience poor coders are those who have failed to abstract the design enough. Everything is too literal and turns out long-winded and totally inflexible. As **ftg** says; the world is full of poor coders who can grind out 1000s of lines, but their overall design sucks because not enough thought has been put into it. This isn’t necessarily a skill you need to be born with. Half of it is being taught good design and coding practices.

Then good programmers need the ability to break that abstraction into a series of logical, foolproof, little steps. This isn’t far removed from mathematical thought, I suppose.

---

<div class="post-metadata">

### Author: ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)
#### Post date: [November 24, 2004, 5:08pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/45 "2004-11-24T17:08:03Z")

</div>

> [@Mathochist](#):
>
> [hijack severity=“slight”]  
> Programmers here have now mentioned set theory three times. I have yet to see a computer science degree which required a real class in set theory.
> 
> Just what do you people think constitutes set theory anyway?  
> [/hijack]

My BS degree is from 1973, and MIT made us take lots of algebra classes (not high school!) which covered this in part. I must admit that the undergrad programs where I went to grad school did not have them. We didn’t have an analysis of algorithms class, but I’m not sure it had been invented yet. 🙂 I picked that up in grad school.

Just as an example of how useful this can be, I became a star when I started to work by becoming the first person to do the analysis of the complexity of an algorithm I developed. My boss and my bosses boss were both mathematicians, and were impressed.

---

<div class="post-metadata">

### Author: ![bitwise](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bitwise](https://boards.straightdope.com/u/bitwise)
#### Post date: [November 24, 2004, 5:38pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/46 "2004-11-24T17:38:24Z")

</div>

> [@Mathochist](#):
>
> [hijack severity=“slight”]  
> Programmers here have now mentioned set theory three times. I have yet to see a computer science degree which required a real class in set theory.
> 
> Just what do you people think constitutes set theory anyway?  
> [/hijack]

I believe they are referring to “naive” set theory, in Paul Halmos’s sense, but with less detail.

I am a programmer with a CS degree. I have never taken a course in formal set theory, but I have picked things up on the side while taking various math courses. I know about the Axiom of Choice, and some of its equivalents, and have a layman’s (not sure if this is the right word) understanding of ordinal and cardinal numbers, but I don’t know much about the details. However, from my observations of the usage of the term “set theory” among my fellow programmers, I believe they do not usually include such things when they use the term. I think they mean just an understanding of what a union, intersection, complement, and Cartesian product are.

---

<div class="post-metadata">

### Author: ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)
#### Post date: [November 24, 2004, 6:30pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/47 "2004-11-24T18:30:48Z")

</div>

> [@t-bonham@scc.net](#):
>
> Yes, but most programmers don’t have a computer science degree.

Most older programmers don’t. It’s almost impossible to get a job if you are younger and don’t have the CS degree. I think it is interesting that my company wouldn’t hire you if you didn’t have a CS degree, and most of our senior programmers don’t have a CS degree.

> [@t-bonham@scc.net](#):
>
> Anecdotally, I have noticed a few traits that seem more common among programmers than the general population:
> 
> - background in filing/classification/pattern-matching jobs.

Nope.

> [@t-bonham@scc.net](#):
>
> - background in music.

Yep.

> [@t-bonham@scc.net](#):
>
> - like to read science-fiction or mystery books.

Yep (to both).

> [@t-bonham@scc.net](#):
>
> - like logical puzzles (crosswords, word problems, etc.)

Yep.

> [@t-bonham@scc.net](#):
>
> - exacting, detail-oriented, nit-picking kind of personality.

I don’t think I’m nit picking, though Mrs Geek might disagree. Personally I think a good programmer needs to be detail oriented when needed and abstract oriented when needed, and needs to know the difference of when to be which.

> [@t-bonham@scc.net](#):
>
> - logical, follow-the-evidence type of mindset.

Yep.

I got 5 out of 6. Make of that what you will.

Indidentally, I have gone to school for both EE and CS. There was a lot more math required for the EE degree. The only math the CS required that the EE did not was a course in advanced discrete mathmatics. This made a lot of sense later. I’ve done a lot more calculus type scribble on paper math for EE work, and more discrete math while programming.

If you do low level machine programming (assembly code and such) then you have to be pretty decent at discrete math and integer math, otherwise you are going to get really confused by why 14 divided by 45 multiplied by 16 is zero. As others have pointed out though, there are plenty of programming jobs where math is not such a requirement.

Computer programming is mostly about how to make the computer do what you want given the small number of instructions you can give it. Computer programming is actually more of an art than a science. When you are done, your program is a piece of art composed of tiny little fragments all arranged in a particular order. If another programmer had been assigned the same task, their program may have looked the same from the user, but it would have been made of different little fragments all stacked together in a slightly different way.

---

<div class="post-metadata">

### Author: ![Mathochist](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Mathochist](https://boards.straightdope.com/u/Mathochist)
#### Post date: [November 25, 2004, 1:49am UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/48 "2004-11-25T01:49:17Z")

</div>

> [@bitwise](#):
>
> I believe they are referring to “naive” set theory, in Paul Halmos’s sense, but with less detail.
> 
> I am a programmer with a CS degree. I have never taken a course in formal set theory, but I have picked things up on the side while taking various math courses. I know about the Axiom of Choice, and some of its equivalents, and have a layman’s (not sure if this is the right word) understanding of ordinal and cardinal numbers, but I don’t know much about the details. However, from my observations of the usage of the term “set theory” among my fellow programmers, I believe they do not usually include such things when they use the term. I think they mean just an understanding of what a union, intersection, complement, and Cartesian product are.

Okay. Not set theory in any real sense, then.

---

<div class="post-metadata">

### Author: ![RickJay](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@RickJay](https://boards.straightdope.com/u/RickJay)
#### Post date: [November 25, 2004, 2:34am UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/49 "2004-11-25T02:34:06Z")

</div>

My best friend is an extremely successful and respected computer engineer with years of programming experience. He sucks at math.

---

<div class="post-metadata">

### Author: ![DavidApollo](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@DavidApollo](https://boards.straightdope.com/u/DavidApollo)
#### Post date: [June 30, 2011, 4:45pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/50 "2011-06-30T16:45:47Z")

</div>

To be good at programming you can be good at math, however the two disciplines are completely unrelated to each other. The people with the highest aptitude for programming are people who are also gifted in the compositional arts such as music, painting, writing, film or theater directing or even choreography.

In the 1960’s an insurance company did a study to find out who they should hire to train to program their mainframes (as computer science as a college major did not exist yet). They found that musicians and English teachers made the best programmers (in that order).

I’ve been working professionally as a software developer since 1982. And indeed the best programmers were those people who were good at music, in particular composition and arranging. The very worst programmers I ever worked with had PhD’s in math. I’ve worked with two such people and they had zero knack for programming.

I was always good at math, but I’m also a musician, composer and writer. It is these latter talents that allow me to be a good programmer.

---

<div class="post-metadata">

### Author: ![Lukeinva](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lukeinva/32/17872_2.png) [@Lukeinva](https://boards.straightdope.com/u/Lukeinva)
#### Post date: [June 30, 2011, 5:14pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/51 "2011-06-30T17:14:53Z")

</div>

_Do computer programmers need to be good at math?_

No. They need to be good at _Logic_. (Btw, a computer can only add.)

---

<div class="post-metadata">

### Author: ![amanset](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@amanset](https://boards.straightdope.com/u/amanset)
#### Post date: [June 30, 2011, 5:25pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/52 "2011-06-30T17:25:32Z")

</div>

> [@lukeinva](#):
>
> _Do computer programmers need to be good at math?_
> 
> No. They need to be good at _Logic_. (Btw, a computer can only add.)

But when using higher level languages this is something rarely seen by a modern programmer. We don’t tend to get down and dirty in assembler much anymore.

Regarding set theory, computer science crosses over into pure mathematics when you study semantics of programming languages. You go high enough and you’re basically writing mathematics papers.

---

<div class="post-metadata">

### Author: ![gazpacho](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@gazpacho](https://boards.straightdope.com/u/gazpacho)
#### Post date: [June 30, 2011, 5:26pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/53 "2011-06-30T17:26:14Z")

</div>

> [@merrily](#):
>
> Don’t most computer science degrees require calculus or even more?

Calculus is basically math 101. The very beginning of math study at the college level. Most computer science degrees require a little more math but not much more. And the requirement stems from a general requirement of having X number of course in math that is common to all the sciences or engineering degrees. Not because you use calculus to from most programming tasks.

---

<div class="post-metadata">

### Author: ![gazpacho](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@gazpacho](https://boards.straightdope.com/u/gazpacho)
#### Post date: [June 30, 2011, 5:37pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/54 "2011-06-30T17:37:20Z")

</div>

> [@lukeinva](#):
>
> _Do computer programmers need to be good at math?_
> 
> No. They need to be good at _Logic_. (Btw, a computer can only add.)

Almost all computers can multiply. At the most basic level of hardware there is something that take to numbers and outputs the product of them in one clock cycle. If that is not multiplying then people can’t multiply either we just use look up tables and addition same as computers.

---

<div class="post-metadata">

### Author: ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)
#### Post date: [June 30, 2011, 5:49pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/55 "2011-06-30T17:49:00Z")

</div>

[QUOTE=lukeinva]  
(Btw, a computer can only add.)

[/QUOTE]

Addition? Man, that’s _way_ too posh. Computers can only do NANDs.

---

<div class="post-metadata">

### Author: ![robert\_columbia](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@robert\_columbia](https://boards.straightdope.com/u/robert_columbia)
#### Post date: [June 30, 2011, 6:00pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/56 "2011-06-30T18:00:34Z")

</div>

> [@CandidGamera](#):
>
> Yes and no. Certainly, I’ve known programmers who can’t do trig, or calculus, of the like. But certain kinds of math use the same parts of the brain (or seem to) as programming. Set Theory was taught as part of my CS curriculum.
> 
> More generally, the step-by-step logical problem solving aspects of math are very much like those of CS.

Set theory and discrete math in general are helpful. Continuous math, not so much. In the years that I’ve been working as a developer, I can only think of one time that I actually used any calculus.

Discrete math is the foundation for formal languages, which leads to compilers. Understanding this is quite helpful sometimes.

I think it is true that the discipline necessary to learn, and/or obtained from learning, calculus, trig, linear algebra, etc. does contribute to being a good programmer. Programmers have to think logically as well as creatively. Having explored different mathematical techniques gives you a world perspective that is conductive to problem solving.

---

<div class="post-metadata">

### Author: ![Keeve](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@Keeve](https://boards.straightdope.com/u/Keeve)
#### Post date: [June 30, 2011, 6:12pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/57 "2011-06-30T18:12:32Z")

</div>

> [@DavidApollo](#):
>
> In the 1960’s an insurance company did a study to find out who they should hire to train to program their mainframes (as computer science as a college major did not exist yet). They found that musicians and English teachers made the best programmers (in that order).

As a former programmer, that makes total sense to me. Both of these professions allow (indeed, they demand) a good deal of artistic creativity, but they also demand that one follow the rules. If a note is too flat or too sharp, or a verb is in the wrong tense, the musician and teacher will cringe as much as an average person does when hearing fingernails across a blackboard. And programming too, is totally open to creativity, but also demands that the rules be followed. The computer will do exactly what you tell it to do - whether that’s what you meant or not.

---

<div class="post-metadata">

### Author: ![Punoqllads](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@Punoqllads](https://boards.straightdope.com/u/Punoqllads)
#### Post date: [June 30, 2011, 6:15pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/58 "2011-06-30T18:15:50Z")

</div>

Zombies make the best programmers.

---

<div class="post-metadata">

### Author: ![aceplace57](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/aceplace57/32/3500_2.png) [@aceplace57](https://boards.straightdope.com/u/aceplace57)
#### Post date: [June 30, 2011, 6:27pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/59 "2011-06-30T18:27:26Z")

</div>

I’m a business programmer. My specialty is in payroll, insurance and other related reports.

I’ve had to program some basic insurance calculations. For example our Opt LTD insurance is a percentage rate times the employees salary \> than 20k.

so a 30k employee pays for 10k of opt ltd insurance. take that times the rate and divide by the number of pay periods. We’re semi monthly. a 9 month employee has 18 pay periods. 12 month emp 24 pay periods. 10 month, 20 pay periods

Not exactly high math. 😃 But, you have to do this sort of thing working around payroll/HR offices.

---

<div class="post-metadata">

### Author: ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)
#### Post date: [June 30, 2011, 7:08pm UTC](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283/60 "2011-06-30T19:08:15Z")

</div>

To continue what ftg said (although what’s a PHB?), I will recount a conversation I had with a friend of mine at U. Ill. who knows Steve Wolfram well (my friend’s son did much of the mathematical algorithms for Mathematica). I mentioned to him that I read somewhere that the average programmer produces 7 lines of commented debugged code an average day. My friend remarked that Wolfram produces 1000. I said, “Is Wofram 140 times as productive as the average programmer?” My friend replied, “Yes.”

Now here is my experience. I have done some programming, including a mini-interpreter for tex (back in the early '80s when tex on microcomputers didn’t exist). Did I use any math at all in doing that? Not that I can think of. On the other hand, my ability to analyze that serve me well in math were certainly relevant.

This has little to do with computer science, however. That is heavily mathematical. In fact, some of my own mathematical results have been heavily used in some kinds of CS. I have to say, I don’t understand what they have to do with computer theory, but I’m happy enough to see them used. So if you want to go into computer theory you will have to learn lots of quite advanced math.

[Previous page](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283.md?page=2)

[Next page](https://boards.straightdope.com/t/do-computer-programmers-need-to-be-good-at-math/276283.md?page=4)
