Should Competent Programmers be "Mathematically Inclined"?

You’ve got it all wrong. It’s not that specific math tools are useful in programming, it’s that math and programming flex the same mental muscles.

iTo me, this reads like a broad recipe for becoming intellectually curious and building skill at solving abstract problems. Important programming skills, to be sure, but not necessarily exclusive to the study of math./i

Intellectual curiosity is certainly universal, but solving abstract problems is the exclusive domain of math. Anywhere else you might think you’re solving abstract problems, they can (and likely should) be represented with math.

As for there being no right answer, I think you’ve been writing too much javascript. There may be no correct overarching way to solve problem X, but individual statements, lines, modules, and ultimately executables either work, or they don’t. Compilers are, if this is possible, imore/i pedantic than formal math. Both math and programming benefit from an ability to think, speak, and write in a highly specific and precise manner, and so doing one trains you for the other.

I’m constantly surprised, that math is such useful in daily programming job. And my current job is in big enterprise company writing business logic in Java, so I did not think it would be like that. Still, I’m happy, the more math the less boring stuff.

Last time it was ejb bean that can call any method on any SessionBean on server using reflection. It gets parameters for this method searches for method with given name that is the best for such parameter types. Java reflections doesn’t provide way to find the best method simply, so I had to reimplement it by hand.

Matching method to parameters types is not straighforward (in some cases its ambigious which method should we run), so I’ve constructed algorithm for it and it was math, I’m sure, I can recognise it, when I see it.

Also, graph theory is often very useful, it gives you simple and effective way to think about complicated problems (may this be definition of math?).

So, I can’t agree with you.

I’m new to programming and keep hearing that math is essential. It may be, but I haven’t found any exotic forms of math required so far. Thank you for confirming my suspicions that being a math whiz isn’t so necessary to being a good programmer.

Someone needs to define what good at actually means. Most people use it in a relative/subjective sense, often comparing themselves against someone else.

I use it sometimes for defining sophisticated logical expressions. In this level, mathematical logic really does the job.

I’m a CS major. More than half my classes are math. I hate math. Someone please help me.

I would like to mention that the quote says mathematical inclination. This is not at all equal to knowledge of any particular mathematical concept, but more of a general assessment of what kind of competence one should be looking for. The common traits that are needed to be good in math and to be good at programming are very much the same: creative thinking, abstraction, logic, …

While many particular mathematical subjects have their uses when programming (such trigonometry for graphics, calculus for simulations, graphs for networks or version control, and so on) that is another issue.

Previously you have stated that you are not good at math, and backed that up with your SAT-scores. I would argue that this has nothing to do with whether or not you are mathematically inclined, just that the math one has to know for the SATs is not math that you are interested in learning. I guess that you would find the right kind of math for you both fun and easy, since you seem to be a good programmer.

Jeff, you are misunderstanding Djikstra.

Programming is maths. Programming is an application of Computer Science, and Computer Science is a branch of mathematics.

Do not think of maths as simply being Calculus and stuff to do with numbers. Algorithms, type systems, data structures are all parts of maths, and I don’t think you’d disagree that knowing these things is incredibly important to being a good programmer.

As a programmer considering himself as not good at math i proclaim that math can help in programming ;).

Ttheory of sets helped me to understand nested sets.

Without math you will be doing only shitcoding (what 95% of programmers do for living - web development, enterprise development etc, other copypasting). Remaining 5% do some thinking, and this is where some math knowledge is helpful. The more the better!

It looks like Jeff is confusing math with arithmetic. A mathematically inclined person who is also good with languages can think abstractly and turn those abstractions to concrete implementations.

E.g., someone who doesn’t understand set theory is bound to misunderstand what relational means in the phrase ‘relational database’.

I felt a little bad after reading this because I think you have given a bad interpretation of what Dijkstra said in that extract.

I think that a mastery of one’s native tongue is necessary for a programmer not because of the literary or grammatical value, but for the ability that gives to you. When I am programming I feel pretty much the same way as when I am writing something like a post in my blog or this commentary. I have to keep remembering and having in mind what I wrote and trying to make my point. Programming is kind of the same thing, we have our symbols, our sintaxis, but most important the logic that is within what we type. Dijkstra wasn’t talking about languages, but the mastery of the language. I am mexican, and though my english is not near perfect, my mastery of spanish is quite good, and I have found that that has been useful for me.

And about math I feel the same way. I am pretty bad at math myself. But I’ve always been naturally good at programming. When I was in university I was always failing at my Calculus courses, but in the programming courses was quite the contrary. Which would give you the reason. But I think programming is very different from calculus, but is more like algebra and certainly even more like logic, and when I was in a course of IA and was studying formal logic, which nobody can’t say it’s not a part of math, I wasn’t that bad.

Probably all programmers are different, and maybe when Dijkstra wrote that, programmers did have to have exceptional skills in math, because in those times things were pretty different, but I still think is not about math or languages he was refering, but to the abilities that share with the very complex art or science or whatever it is programming.

Mathematics encompasses a wide range of knowledge, so it’s almost certain that Dijkstra is correct. :wink:

The core of mathematics is the study of form, structure, pattern and relationships. Regardless of what branch you are in, this is the underlying foundation - Given these rules, what structures exist and can be proven, and what can be proven not to exist? And of course the meta-mathematics: How do these properties vary as the rules are changed?

It is no coincidence that Christopher Alexander was a mathematician before becoming an architect.

Even in the most applied numerical computational result-focussed areas, where the rules might be implicit and the behavior emergent, this is still the endeavor.

one word : Bayesian filtering for spam
http://www.paulgraham.com/spam.html

Discrete math was useful when learning programming and problem-solving skills. I rarely use any mathematics beyond simple algebra (eg, scale a number from one range to another range) and of course basic arithmetic (calculating address offsets, etc.).

The problem is that you hear math and you think geometry, algebra, trigonometry, calculus, which is insanely narrow considering you quote a guy like Dijkstra. What he was most likely referring to was fields of mathematics that deal with sets, logic and recursion like finite math, discrete math, set theory, graph theory, combinatorics, etc.

Will you be a bad programmer if you don’t know those things? Not necessarily. What Dijkstra meant was that there is a strong correlation between the aptitude required for being good at things like graph theory and the aptitude for writing good programs; namely, analytical problem-solving. The worst programmers I know attempt to solve problems by throwing things against a wall and seeing if they stick.

Well if you don’t get algebra then you will never understand
int x = 4*y + 5;

I don’t think most people have trouble with algebra…oh wait, yes they do. it was taught in high school. few understood it.

yes you can program with a cursory understanding of math but i’ve noticed a correlation between people who don’t really understand math and the people who don’t program well. they can have years and years of experience writing code but they can only understand programs at the most trivial levels. it’s all voodoo to them.

Not that understanding math will make one a good programmer–you need to write lots and lots of programs for that and debug lots of other people’s programs. But math gives your brain the tools it needs to be able to reason about programs, because programming is math. Recursion and iteration (sigma notation) come from math. proofs. Inductive proofs (so you don’t have to write tests for every possible input value). and so on. it’s all math.

if you can program then you are implicitly doing math. it helps (though you can get by without) to have a formal understanding of it.

that said, you don’t need math to make websites.

Well there’s some fields that you must be very good at numbers and conversion. Micro controllers programming is one those fields. It’s not uncommon to code Asm alone in a single project. Hex to Bin to Dec fast mental conversions is A MUST. And you can’t count on Standard templates library because it takes too much space (think about 2kB of RAM and 16 registers to work with). Most of the time you have to implement algorithms yourself, because there’s close to zero chance of finding algorithm implemented for uC you’re working on. Also there’s a wonderful world of FPGA where you must have good logic algebra skills to reduce gates count and program C/Asm at the same time.

I generally agree, but many have connected aptitude in music to math as well. If you know and appreciate music (not just the sound, but the structure), then math is easier for you. But that involves left and right brain as well.

I think the lynchpin with high school math that made me a better programmer was my natural love of (GASP AGAIN) WORD PROBLEMS! I loved word problems and always asked the teacher to assign us more of them (other students of course wanted to kill me).

But word problems are a quasi-real world application of the skills we were learning. It taught us application and problem solving rather than just here’s the formula, solve it.

Jeff, how were your math marks? =)