# Programming ability and Math ability

**URL:** <https://boards.straightdope.com/t/programming-ability-and-math-ability/674845>\
**Category:** In My Humble Opinion\
**Created:** [November 26, 2013, 6:13pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845 "2013-11-26T18:13:21Z")\
**Posts on this page:** 16\
**Page:** 3

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [November 27, 2013, 5:38am UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/41 "2013-11-27T05:38:17Z")

</div>

> [@Dr.Strangelove](#):
>
> Were Donald Knuth to interview where I work, I’d likely have the same opinion. He’s a computer scientist, not a coder. It’s just a different thing.

To clarify another thing: obviously Knuth writes/has written a tremendous amount of code. I just wouldn’t call him a _coder_ in the same way as–for example–John Carmack or Michael Abrash are _coders_. It’s possibly a fine distinction that isn’t shared by all, but as I see it the former are happy to see machines as abstractions and that the product of their work is largely in the ideas expressed, whereas the latter type embraces the limited nature of the machine and the work is largely in the implementation.

Obviously there’s overlap between the two types as well as need. But I’ll claim that most software engineering requires more skills from the latter set.

---

<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:** [November 27, 2013, 4:54pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/42 "2013-11-27T16:54:52Z")

</div>

> [@Grestarian](#):
>
> Au Contraire!  
> Did you say excellence at Geometry, particularly proofs?
> 
> ‘Computer Science relies heavily on principles of Deductive Reasoning – applying general rules that hold over the entirety of a closed domain of discourse and narrowing the range under consideration until only the conclusion is left.’ [I’m paraphrasing a Wikipedia article here]
> 
> The proofs I did in my college Logic courses tended to get very large and convoluted, but ultimately employed Boolean logic to boil everything down to _Statement = True or False_. Similarly, proofs in geometry will tend to boil down to True/False – it’s just that the statement being tested will be of a different and limited nature.  
> Deductive Logic – Ponies are Horses  
> Boolean logic – X therefore Z  
> Geometry – Outside interior angle A is equal to outside exterior angle H  
> And of course the rules governing the domain are different, but the point is to learn to properly apply the right rules to the situation being tested.
> 
> Programming languages are, ultimately, sets of rules and prescribed methods for applying them. Programming is a matter of applying the rules and methods of a programming language to achieve a result – a number is calculated, a light goes on, an on-line purchase is successfully completed, etc.

I’d say most mathematical proofs can be broken down into sections much like code. Definition are assignments. Lemmas, corollaries and theorems are methods. The overall proof is the program.

amanset  
BSc Pure Mathematics  
MSc Software Engineering  
Currently working as a programmer in a rather niche area of the games industry.

---

<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 27, 2013, 5:49pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/43 "2013-11-27T17:49:21Z")

</div>

> [@Dr.Strangelove](#):
>
> With all due respect, going 35 years without needing any real math tells me you’ve had a poor diversity in things you’ve worked on. I’m sure you’re fantastic in the things you have experience with, but I doubt I’d hire you for anything because I couldn’t be confident that you could solve novel problems.
> 
> Sure. Data structures go without saying, as do algorithms. I just think you need math, too (as do many of my colleagues).

Poor diversity? I’ve been a “World’s Leading Authority™” in two different and distinct areas. With the spread of computer science in the last 40 years no one can cover everything. I started in computer architecture, then helped invent a major area of electronic design automation, and am not working on Big Data kind of stuff. All very diverse and none having to do with certain kinds of math. I’m better at math than 99% of the people out there (got 800s on both the SAT and the Level II Achievement test, back when they were hard) but I know people who are really good at math, and I don’t have that skill. It’s genetic, based on my kids.

So my not working in your area does not reduce my diversity. CS has exploded in diversity. Back when I was on the Editorial Board of IEEE Computer I could read, understand, and mostly care about every paper, and the special issues I edited were of reasonable appeal to the broad audience. No longer, as specialty magazines have been spun out and my special issues go to them. (And my column is in one of them.)  
There is room enough in this field for all of us.

---

<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 27, 2013, 5:59pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/44 "2013-11-27T17:59:07Z")

</div>

> [@Dr.Strangelove](#):
>
> To clarify another thing: obviously Knuth writes/has written a tremendous amount of code. I just wouldn’t call him a _coder_ in the same way as–for example–John Carmack or Michael Abrash are _coders_. It’s possibly a fine distinction that isn’t shared by all, but as I see it the former are happy to see machines as abstractions and that the product of their work is largely in the ideas expressed, whereas the latter type embraces the limited nature of the machine and the work is largely in the implementation.
> 
> Obviously there’s overlap between the two types as well as need. But I’ll claim that most software engineering requires more skills from the latter set.

However one of the reasons we loved Knuth’s books (which were new when I was in grad school) was that he showed implementations of his algorithms, and in basically assembly language. Back then we didn’t have the luxury of large libraries which did most of the grunt work we wanted to do far more efficiently than we could ourselves. If you wanted a sort you had to write one, and you had to understand which one to write.

In the areas where I work the best people are both researchers and programmers. Papers where the supposedly great new algorithm produces crappy results because of a poor implementation don’t get published, and reviewers jump on them. (Not just me, but pretty much all the reviewers for one recent case.) I guess there are still places where person A writes the detailed flow and person B codes it, but I’ve fortunately never had to work in such a place.

---

<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 27, 2013, 6:02pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/45 "2013-11-27T18:02:30Z")

</div>

> [@Terr](#):
>
> I’ve been writing financial applications for ages. You have to know and understand algebra, statistics, be able to read fairly densely written mathematical formulas for some difficult indicators. Doing Black-Scholes models involves differential equations. And don’t start me on calculation of option greeks.

I hear you. My daughter has an Econ degree from Chicago, and that math was nasty. She decided to take the Psych and Marketing route, and that math was so much easier.

---

<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 27, 2013, 6:15pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/46 "2013-11-27T18:15:41Z")

</div>

> [@Dr.Strangelove](#):
>
> Fair enough. I was unaware of Voyager’s history. I apologize if any insult was received.
> 
> However, I should clarify something, which is that straight CS is actually a pretty different thing than “coding”. Coding is an engineering discipline, while CS is… well, science, arguably, or perhaps its own branch of math, but at any rate a fairly different thing than engineering.
> 
> So when I say “poor diversity” I want to emphasize that I mean “diversity in the realm of things that software engineers do”, which is not at all the same range of things that real computer scientists do.
> 
> Were Donald Knuth to interview where I work, I’d likely have the same opinion. He’s a computer scientist, not a coder. It’s just a different thing.

I’m a computer scientist too, at least my PhD says so. 😃 Things were a bit different 40 years ago. (I was in only the second class at MIT where you could actually major in computer science.) It was a small enough field so you were expected to know everything - from semiconductors to numerical analysis. Not databases - they were in the process of being invented. Every CS student had to know assembler, how to write a compiler, and more of the insides of operating systems than I think they need to know now. We learned semaphores which Dijkstra had just invented, which came in handy very recently. It appears that my younger colleagues never heard of them, but that stuff is buried.  
There was no computer engineering back then, it was part of CS, with some universities caring more about hardware than others.  
No one talked about diversity since it was understood you had to know the whole range of the field in order to pass your quals. My adviser at Illinois, who was a mathematician and one of von Neumann’s students at Princeton, was working on computer architecture and networks when I was there.  
My younger colleagues know a lot more about certain areas than I do, but they don’t have nearly the diversity in the fundamentals with hands on experience.  
I guess that always happens when you get in at the ground floor of an area.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [November 28, 2013, 4:43am UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/47 "2013-11-28T04:43:43Z")

</div>

> [@Voyager](#):
>
> Poor diversity? I’ve been a “World’s Leading Authority™” in two different and distinct areas. With the spread of computer science in the last 40 years no one can cover everything.

True enough… but suppose you encountered someone who had never used a sort routine? There’s enough material out there that you could spend a lifetime programming sophisticated things without ever needing to sort. But wouldn’t you find it a bit strange?

> [@Voyager](#):
>
> I started in computer architecture, then helped invent a major area of electronic design automation

Cool. We probably use your stuff where I work.

> [@Voyager](#):
>
> I’m better at math than 99% of the people out there (got 800s on both the SAT and the Level II Achievement test, back when they were hard) but I know people who are really good at math, and I don’t have that skill. It’s genetic, based on my kids.

Well, you’re probably better at it than I. I find myself math-limited all the time. I only have the standard run of undergrad engineering math. Sometimes it isn’t enough.

> [@Voyager](#):
>
> So my not working in your area does not reduce my diversity.

That’s true, but I am speaking from \*some \*experience outside my career. I do graphics stuff for a living. But as a hobby I’ve written a software defined radio receiver, the firmware for a satellite, some error correcting software, statistical analysis tools, and lots of other stuff (including more graphics). Maybe this stuff is less diverse than it seems and I’m just self-selecting things that I like.

> [@Voyager](#):
>
> CS has exploded in diversity. … There is room enough in this field for all of us.

Again, you speak wisdom. It’s impossible to keep track of everything. I suppose what it comes down to is that I seek breadth in candidates; deep knowledge is good but much of what we do is fairly open-ended, although not _incredibly_ difficult; hence, we look for people with a rich toolset that they can apply to problems. Data structures and algorithms are a given, but math is important too.

> [@Voyager](#):
>
> However one of the reasons we loved Knuth’s books (which were new when I was in grad school) was that he showed implementations of his algorithms, and in basically assembly language. Back then we didn’t have the luxury of large libraries which did most of the grunt work we wanted to do far more efficiently than we could ourselves. If you wanted a sort you had to write one, and you had to understand which one to write.

Didn’t Knuth design his own fictional assembly language? To be honest I actually haven’t read his books in _great_ depth.

At any rate, being able to write a quicksort is also pretty much a baseline requirement in my book. It’s not that one needs to rewrite it all the time (or _ever_)–it’s that you don’t really understand something until you do that thing, and understanding how sorts work is often pretty important. Quicksort is such an elegant example of a non-trivial recursive program that it seems like it should be burned into every CS grad’s brain (sadly, that’s not the case).

---

<div class="post-metadata">

**Author:** ![sisu](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@sisu](https://boards.straightdope.com/u/sisu)\
**Post date:** [November 28, 2013, 4:52am UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/48 "2013-11-28T04:52:40Z")

</div>

I am quite advanced in math but have not got the patience for programming, bores me senseless…

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [November 28, 2013, 4:42pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/49 "2013-11-28T16:42:53Z")

</div>

> [@Dr.Strangelove](#):
>
> At any rate, being able to write a quicksort is also pretty much a baseline requirement in my book. It’s not that one needs to rewrite it all the time (or _ever_)–it’s that you don’t really understand something until you do that thing, and understanding how sorts work is often pretty important. Quicksort is such an elegant example of a non-trivial recursive program that it seems like it should be burned into every CS grad’s brain (sadly, that’s not the case).

Being able to code even at the level of Quicksort is useless unless you know how to do the analysis that establishes its average runtime. This, I fear, is a skill severely lacking in most programmers and requires some decent algebraic skills. And finding average runtime is a lot harder, sometimes even impossible, than worst case runtime.

If you don’t know ahead of time if the code you are about to write is going to be efficient enough, you should _not_ be programming.

Too many people hope their code will be fast enough, write it, test it, find out it’s a hog and then it’s too late. It gets sent out as the slow, bloated code we are all too familiar with.

---

<div class="post-metadata">

**Author:** ![Terr](https://avatars.discourse-cdn.com/v4/letter/t/839c29/32.png) [@Terr](https://boards.straightdope.com/u/Terr)\
**Post date:** [November 28, 2013, 6:33pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/50 "2013-11-28T18:33:37Z")

</div>

> [@ftg](#):
>
> If you don’t know ahead of time if the code you are about to write is going to be efficient enough, you should _not_ be programming.
> 
> Too many people hope their code will be fast enough, write it, test it, find out it’s a hog and then it’s too late. It gets sent out as the slow, bloated code we are all too familiar with.

It depends. There are time-critical components and there are non-time-critical. I write daytrader software. Being efficient is extremely important, since someone may have 20 charts up with 10 indicators on each, a few L2 windows and a couple of portfolios, all updating in real time with some stocks getting 100 updates a second. So everything is written with speed/efficiency in mind.

But some batch-processing accounting stuff may run at night, and whether it takes 10 minutes or 30 minutes just doesn’t matter. A good programmer will still write it efficiently. An average one will write it sloppy. And no one will know or care about the difference.

---

<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 28, 2013, 8:33pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/51 "2013-11-28T20:33:08Z")

</div>

> [@Dr.Strangelove](#):
>
> True enough… but suppose you encountered someone who had never used a sort routine? There’s enough material out there that you could spend a lifetime programming sophisticated things without ever needing to sort. But wouldn’t you find it a bit strange?

I’m not sure what is taught these days. Now, I taught sorting methods when I taught data structures, so I think it is important. But how often do people need to do a custom sort these days? When I want to sort hash keys, I don’t need any of my sorting experience - except to know that sorts do take time and sorting millions of records when you don’t need to is not a good idea. But kids today have to learn stuff not invented when I was in school, so something has to go.

> [@](#):
>
> That’s true, but I am speaking from \*some \*experience outside my career. I do graphics stuff for a living. But as a hobby I’ve written a software defined radio receiver, the firmware for a satellite, some error correcting software, statistical analysis tools, and lots of other stuff (including more graphics). Maybe this stuff is less diverse than it seems and I’m just self-selecting things that I like.

That’s it exactly. I’ve done a tiny bit of graphics stuff, so I avoid it, and call packages when necessary. On the other hand I like graph theory and so have found ways of using it. When there are tons of areas we enjoy which both pay well and are fun, why spend time doing things we don’t enjoy, even if we could learn them.

> [@](#):
>
> Didn’t Knuth design his own fictional assembly language? To be honest I actually haven’t read his books in _great_ depth.

Yes, based on a very simple machine. Lots of people did that back then.  
This was before there was one language everyone could be expected to know, that was good enough to show stuff. I guess Fortran was close, but pre-structured programming had a bad odor.

> [@](#):
>
> At any rate, being able to write a quicksort is also pretty much a baseline requirement in my book. It’s not that one needs to rewrite it all the time (or _ever_)–it’s that you don’t really understand something until you do that thing, and understanding how sorts work is often pretty important. Quicksort is such an elegant example of a non-trivial recursive program that it seems like it should be burned into every CS grad’s brain (sadly, that’s not the case).

I definitely agree.  
There is a lot of basic stuff that even CS people don’t know, because it is rarely needed. Another example is the very basic concept that programs are data. When I was in high school I wrote a tic-tac-toe program in machine language for our LGP-21 which fit into memory by means of rewriting itself. I had an intern a few years ago who was stymied at figuring out how to efficiently ftp data from one machine to another, without getting everything all the time. The solution was to have the code write an expect script to do it, which was obvious to an old compiler writer but less so for someone who just wrote code and used applications.

---

<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 28, 2013, 8:38pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/52 "2013-11-28T20:38:51Z")

</div>

> [@Terr](#):
>
> It depends. There are time-critical components and there are non-time-critical. I write daytrader software. Being efficient is extremely important, since someone may have 20 charts up with 10 indicators on each, a few L2 windows and a couple of portfolios, all updating in real time with some stocks getting 100 updates a second. So everything is written with speed/efficiency in mind.
> 
> But some batch-processing accounting stuff may run at night, and whether it takes 10 minutes or 30 minutes just doesn’t matter. A good programmer will still write it efficiently. An average one will write it sloppy. And no one will know or care about the difference.

As I tell people, computers are fast. 🙂 I do lots of things which are inefficient because the time I’d need to make it efficient (not to mention increased complexity) would be greater than the time savings.

I was in grad school at about the time the work on algorithmic complexity, so I look at an add for [match.com](http://match.com) and say “that’s of n\*\*2 complexity.” It came in handy because my first bosses boss was a mathematician, and he thought I was quite clever to mention the complexity of my proposed algorithm. Then I suppose we found that anything interesting was NP-hard, and it became boring.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [November 28, 2013, 9:23pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/53 "2013-11-28T21:23:47Z")

</div>

I’m not saying that everything has to be written in a compiled language run thru an optimizing compiler, then key parts re-written in assembler, etc.

For a lot things, scripting languages, interpreters, using already existing packages, etc., make for cost-effective, reliable code.

But you need to be aware if those are also going to be efficient enough. If they are, fine. If they aren’t, then you have work ahead of you.

The issue is being aware of the cost of your choices. Not just in terms of time, but also storage space, bandwidth, reliability, etc.

That takes analysis. Analysis requires some equation setup and solving skills. If you’re not thinking about the consequences of your choices, you are making bad choices.

---

<div class="post-metadata">

**Author:** ![squeegee](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/squeegee/32/14537_2.png) [@squeegee](https://boards.straightdope.com/u/squeegee)\
**Post date:** [November 28, 2013, 11:38pm UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/54 "2013-11-28T23:38:11Z")

</div>

> [@Gagundathar](#):
>
> The simple assignment operation x = x + 1 looks nonsensical to someone who has only taken algebra.

Oh, nonsense. I started programming in elementary school and grasped what that statement meant easily. Where I’m from they didn’t teach algebra until the middle of junior high.

---

<div class="post-metadata">

**Author:** ![Shagnasty](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Shagnasty](https://boards.straightdope.com/u/Shagnasty)\
**Post date:** [November 29, 2013, 1:42am UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/55 "2013-11-29T01:42:40Z")

</div>

> [@squeegee](#):
>
> Oh, nonsense. I started programming in elementary school and grasped what that statement meant easily. Where I’m from they didn’t teach algebra until the middle of junior high.

I agree with that. I started programming when I was 8 years old and understood it both intuitively and easily. Some people that excel at higher math might assume that the parallels they draw from higher math are necessary for programming or computer engineering but they really aren’t. It is a mathematical and logical skill on its own it it doesn’t matter how you did on the supposed prerequisites as long as you can generate the best results.

It is the same thing as saying that musicians that want to excel at their endeavour need to be able to read sheet music by sight and be able to write about music theory an academic level. It isn’t true. Most talented musicians including the inventors of completely new musical genres like jazz or the blues couldn’t tell you the first thing about musical theory or even read sheet music yet they can play. That is the overall goal and it doesn’t matter what skills you use to get there.

I would turn the problem around. Almost all higher level math is useless to 99+% of the population and yet we make all high school students suffer through it. Anything more than the most basic algebra and geometry is not useful to anyone that doesn’t go into fields that directly require it and that is tiny subset of the population. Statistics is much more useful to everyone but, of course, we don’t require that because it would instill actual useful knowledge. The standard defense is that algebra, calculus and trigonometry teach logical skills even if they aren’t directly useful on their own.

That isn’t a good enough answer for me. It is the equivalent of forcing students to take Ancient greek, Latin, German and medieval French before they write their first essay in English. It isn’t productive and you will cause most students to lose interest well before you get to the first practical purpose. A better approach is to just to give assignments that require that more in depth math knowledge and let them figure out what they need to achieve that goal from there.

Programming is an excellent tool for teaching that and much better than the standard educational approach. Either it works or it doesn’t and you get feedback instantly. If you have any conceptual gaps, you have to work through them and learn more until it does work.

---

<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 29, 2013, 2:34am UTC](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845/56 "2013-11-29T02:34:08Z")

</div>

> [@ftg](#):
>
> But you need to be aware if those are also going to be efficient enough. If they are, fine. If they aren’t, then you have work ahead of you.
> 
> The issue is being aware of the cost of your choices. Not just in terms of time, but also storage space, bandwidth, reliability, etc.
> 
> That takes analysis. Analysis requires some equation setup and solving skills. If you’re not thinking about the consequences of your choices, you are making bad choices.

There is one cost you didn’t include up there - the cost of being late. I do lots of quickie programs to sort through millions of data items looking for significance. The users need it right away. Delaying even an hour for efficiency would be a mistake.  
Working for a company which makes computers and storage helps also. I tell someone I need a terabyte of disk, and I get it in a week or less.

[Previous page](https://boards.straightdope.com/t/programming-ability-and-math-ability/674845.md?page=2)
