?
Do you think mathematics and/or physics are an important skill for a programmer? Why?
Steve Yegge:
There is a large branch of mathematics that’s very important for programmers called „discrete math” or „concrete math”. It includes disciplines such as probability, combinatorics, graph theory, induction proofs, and other useful tools. I would encourage all programmers to study discrete mathematics to whatever extent they can. Even a little is better than none at all.
As for more traditional math, well, I don’t use it as often, but it comes in very handy when I need it. For instance, I’ve only used calculus once in the past year as part of my job. I had to estimate loads for the peak traffic hour of the day for a service whose load „follows the sun” in an approximate sine curve. The simplest way to make the estimate was to integrate over 1/24th of the curve at a specific time. If I hadn’t known calculus, I would not have known how to make a reasonably accurate estimate.
When I was writing my game, Wyvern, having a solid working knowledge of basic planar geometry was incredibly helpful. And it’s quite common to use algebra and linear algebra on a regular basis. But I rarely use trigonometry or differential equations on the job, and not much calculus either.
I’d say my basic math foundation has made me maybe 5% to 10% better as a programmer. If I knew a lot more math, I’d undoubtedly be a much better programmer than I am today, so I study and practice math several hours a week.
I love physics and I have an ongoing, lifelong quest to try to understand the underpinnings of quantum mechanics. But I’ve never personally found any physics very useful towards my job as a programmer. That would, of course, be diffferent if I were doing something in a physics domain, such as 3D game programming, or certain types of simulation.
Linus Torvalds:
I personally think a fairly strong math background is a good thing. I’m not as sure about the physics side, but I’m convinced that understanding math and having a good background in it helps you to be a better programmer. If only because the mental models are similar - you can build up any kind of set of rules you want, but it should be self-consistent.
David Heinemeier Hansson:
Not at all. At least not for the kind of business programming needed for web applications. I consider it much more important that someone is a good writer.
Peter Norvig:
Yes. Many ideas are inherently mathematical: induction, recursion, logic, etc.
Dave Thomas:
Maybe. But, to be honest, I haven’t seen much of a correlation either way between these types of discipline and good software developers.
However, I _have_ seen a strong correlation between people who have some music in their background and programming skills. I have no idea why, but I suspect that some of the areas of the brain that make someone musical also make them good at software development.
Guido Van Rossum:
Math, yes (for some parts; I don’t care for differential equations, but algebra and logic are important). Physics, I don’t think so except it’s always useful to be interested in many different things.
James Gosling:
Yes! They teach you logic & deduction…. To have an analytical eye. And there’s no replacement for mathematics when it comes to analyzing algorithms.
Bjarne Stroustrup:
Depends on the programmer and the programming tasks. Some forms of math are frequently useful; physics less often so, but then learning physics is one of the best ways of learning practical math.
Tim Bray:
In my case, I’ve almost never used my university-level math to support my programming.