Should Competent Programmers be "Mathematically Inclined"?

Ugh, yes. Math.
I have such a poor mathematic background but I love the complexity and interconnectivity of programming. A week ago i spent two days trying to write an algorithm to make a curve. I gave up, then some one told me how to do it…

log2(x)

Boy did I feel stupid. At least I got it working, eh?

Math teaches you to abstract, to extract from a problem or system its fundamental questions. This is crucial to designing systems well. Now that does not mean that you cannot learn abstraction elsewhere. A formal math education is something like becoming a distance runner. It makes other things far easier.

As for specifics: optimization is a matter of minimizing a given metric. What metric? For that matter, what is a metric. Go learn a bit of topology.

Many optimization algorithms (while we’re on the topic) are simple linear algebra. Of course it’s only simple if you know a bit of abstract algebra and then learn linear algebra.

Numerical approx. is all calc, diff eq pde. What’s the diff between various definitions of integration, and how do they resolve poles?

Want to implement a codec? You’ll probably need to know some non-trivial number theory, finite group theory, and perhaps even finite geometry.

And so forth. The interesting areas often involve math. The boring ones, not so much.

Cheers,
Scott

And then there’s the very strong motivational relationship between functional programming and category theory. If you’ve never heard of a category, functor, modad (monoidal category), or natural transformation you’ll struggle more with functional programming.

Scott

No one has ever tried to localize the number 3?

How about the Chinese character #19977;? (That’s three parallel horizontal lines, for those of you whose browsers aren’t showing the character.)

set theory is what underlies databases but for comercial programming you dont realy need Maths.

You don’t? I haven’t run across too many commercial programing projects that didn’t involve a database. And if you haven’t got some understanding of set theory, how is your code going to interact with the database? Poorly.

Weird timing. I have always been abysmally bad at math. About 10 years ago I started programming. Now… in my 30s I am back in college trying to get a degree … and I have to take Algebra. I am finding it MUCH easier to learn this go round.
I don’t think that math skills are all that much of an asset to your average everyday programmer who does nothing more than shuffle data from one field or database to another, but I can see if you are writing a 3-d library, financial analysis software, or low level software where you have to know how to make a computer perform multiplication without using the * operator.

Back a long time ago I had to write an ad for Honda that grabbed a long/lat and found a point like… 623 miles away or something, the math for computing the curved surface of the earth and the distance between long/lat points was ridiculous. I didn’t write the algorithm, but I did have to translate it to the language I was using and test it.

Good times. …

PI was nearly localised in 1897 when the Indiana House of Representatives unanimously passed a bill stating that ëa circular area is to the square on a line equal to the quadrant of the circumference, as the area of an equilateral rectangle is to the square of one sideí - which I think puts PI = 4!!

I think that maths and programming are intrinsically linked although you can excel at either without necessarily being good at the other. I think you’re spot on when you say that programmers lean Just In Time - which suggests that as a breed, we’re matahematically capable, or predisposed, but don’t necessarily develop that trait.

It’s a little like being fit, but not playing specific sports until you need to.

uh, wasn’t the calculus localised - germanys leibnitz vs. britains newton?

I agree. I view programming as more of a logic and artistic endeavor than a mathematical one. Unless you are writing compilers, heavy 3-D graphics programming, or low level programming, basic mathematics is more than capable of carrying a programmer forward. Most business programmers (and I’m sorry, that’s most of us) just need basic math skills to make sure calculations are correct. Programming is a way of thinking, not something that you have rules for everything as in mathematics. I think language and thinking skills are infinitely more important than math skills. Documentation and clearly written code are much more important than advanced theory and calculus.

Dijkstra talks about the old (golden) age of programming where programming required very good mathematical skills.

A good programmer those days needed to be skilled in designing new algorithms (because there were not much downloadable libraries), and optimize their code to fit into whatever meagre memory they were provided with.

If you are talking about web development kind of programming, of course you need not be very good at mathematics for that. But I do not consider web development anywhere near REAL programming.

These days we are just combining some already availbale modules and (Voila!) you have a new application. This readucec the need for any deep mathematical knowledge. I think we are becoming more of desingers that programmers. We take all those pre-built libraries and then neatly arrange them together.

Good at Math = Good a Programming is not from knowing some specific math bits. It’s the thought processes that math requires (i.e., logic, correctness, completeness). If a person is good at math (any math), then he MUST be capable of thinking a problem through logically and finding/developing an algorithm to solve it. That’s the same skill set required for programming. Also, see this:

a href=http://en.wikipedia.org/wiki/Claude_Elwood_Shannonhttp://en.wikipedia.org/wiki/Claude_Elwood_Shannon/a

for a bit of information on the linkage between Boolean algebra and computers.

Early on I often felt pretty ashamed about being a software engineer and not being great shakes at math, but I think you’re absolutely right when you say that programming involves a lot of right brain activity, too.

I feel that there are generally two extremes with programmers, the guys who are good at math and know how everything works on a low level, and the guys who are more artsy and are good at design and abstraction. IMHO you need both types (and a few in between) to make up a really great team. They tend to provide checks and balances for each other (even if the math guys tend to look down on us right brain types:).

Great article!

Lower mathematics, such as the calculus we took in first year, is no more than plugging numbers into formulas. It’s the same as implementing someone else’s algorithm. Higher mathematics, however, needs the same thought process as constructing elegant algorithms. I think those who never took higher math can’t understand what Dijkstra said.

That question has been asked, and responded, over and over everywhere…

Here’s a little analogy: if virtually none knows how to make a mechanical clock yet, shouldn’t the process of designing and manufacturing one be approached in careful, logical measurement?

Dijkstra’s time is the Stone Age to our Bronze Age. With the absence of any physical law to fall back on, and primitive programming environment (hardware, language, software tools), math is the only primary device available, back then, to cope with the complexity of constructing software.

Any way we want to interpret his remark in the context of our own era, it doesn’t diminish math’s importance to the development of computer science.

Having the knowledge of doing something and actually using it are different things. I like to know that if I ever need a certain formula or simplified way of doing something that I can do it. The lower level math is forever planted in my brain, therefor it is easier for me to use it more often than the higher level.

I am just a CS major in college (freshman), so a lot of our assignments are based more toward using a more efficient way of doing something that we have already done.

Mathematics is the language of the universe. It is the ultimate programming language. If you have ever spent anytime in advanced mathematics, ( real analysis, modern algebra, etc ) you quit plugging and chugging with formulas, you begin to organize and construct proofs. This exercise not only requires a sharp analytical mind, but the good proofs always involve a great amount of creativity. The elegant solution is always beautiful and concise. Compare this to programming. The easy solution is typically longer, uses less advanced maneuvers ( theorems if you will) and is just plain old ugly. The ability to write clear and concise code is a one-to-one function with the ability to construct elegant proofs.

I don’t have much formal maths education, which is probably why, when I was writing an Asteroids clone in Flash a few years back, I wrote my own insanely complicated functions for calculating directional velocity instead of using SIN and COS. I also get a bit lost around maths-like terminology such as arbitrary complexity or O(logn).

not math but logic is the key.

I was writing an Asteroids clone in Flash a few years back, I wrote my own insanely complicated functions for calculating directional velocity instead of using SIN and COS

fantastic, LOL! This supports Steve’s position – it illustrates that you’d need enough math background to at least know in what general direction you should be looking. And save yourself some coding time and pain to boot.

When Dijkstra mentionned a mastery of the native tongue as an asset for a programmer, he didn’t mean that you need to express yourself in it. He just meant you need to master a tongue. Why ? Because language is left side brain. Good programmers are often good at word games (in their native tongue). Just because you need something doesn’t mean you actually use it. It means you need it because while you developped it, you also developped a lot of other side proficiencies.

In mathematical inclinaison, I can understand that too. People remotely good at mathematics can understand the abstraction and the formalism present in a computer language. Also, it helps a lot if you want to understand shortest path algorithm, image processing and stuffs like this.

I worked on ultra-large scale websites (100k servers) and sometime you cannot just add hardware (to quote you). 100k servers is not something even remotely cheap. You need to improve your algorithms to improve performances, and to do this, you need proper algorithm understanding, which is usually developped with math (graph and number theory).