Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
Is it possible to become a good programmer if you don't like math?

Do we have to learn Mathematics to be a good Programmer?

share|improve this question
1  
@Mark Not necessarily. Learning a subject and liking it are two very different things. – Maxpm Mar 7 '11 at 8:09
Do we get any advantage if we are really good at math? – Jervis Mar 7 '11 at 9:29
3  
Are you a king? Or conjoined twins? If no, I suggest you stick to "I" when referring to yourself. – drxzcl Mar 7 '11 at 9:57
I'm pretty disappointed this is taking so long to close. – ChaosPandion Mar 7 '11 at 15:17
If you have Internet access, no. Most of modern-day programmers copy+paste source code from the code samples on the net and stackoverflow.com – CMR Mar 7 '11 at 15:38
show 1 more comment

marked as duplicate by Mark Trapp, Jonathan Khoo, Walter, ChaosPandion, JB King Mar 7 '11 at 15:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

14 Answers

up vote 15 down vote accepted

Math and programming are very closely related as math is really the universal language between humans and computers. You do not need to know a lot of math for high level programming as a lot of that is behind the scenes, but it will aid in comprehension for a lot of more advanced programming concepts. If you plan to do more low level programming (systems or device programming), then you will need to know a lot more math.

share|improve this answer
10  
+1. You'll also need math if you want to do "high level" things like signal processing, machine learning, computer vision, 3D rendering, physics simulations, animations, computational geometry, cryptography and probably many other fields I can't think of right now. – nikie Mar 7 '11 at 9:17
1  
@nikie: Yeah, but that's applied mathematics. Huge difference. ^^ – gablin Mar 7 '11 at 15:21

It depends on what you're programming. A 3D game engine, for example, would be extremely difficult (if not impossible) to pull off with any degree of coherency without knowledge of the appropriate mathematical concepts.

share|improve this answer

To be honest, I was a horrible math student in school. Algebra was completely beyond me at the time, and I don't think I ever got higher than a D in it.

However, a few years later, after having worked as a professional software developer, I went back to college and took a course in algebra. To my amazement, it was the easiest class I had, and I got an A in it.

Truth was, programming taught me algebra, because virtually everything is just an algebraic expression.

So no, you don't need it to start. It helps, but it isn't required. The beautiful thing about software development as a means to teach math is that the compiler, debugger, and executing program are wonderful ways to verify that you've got the answer correct. In this regard, debugging particularly is a huge boon to learning, because you can step through the code and watch each step of your algorithm's evaluation.

share|improve this answer
I am back in school after 10 years of developing software and I am experiencing the same thing. I find Calculus and Statistics much easier as I can relate most of the concepts to some functionality that I have written over the years. I get angry when I think about not known Venn diagrams when I taught myself SQL joins. It's like cheating. – Heath Lilley Mar 7 '11 at 20:05

You have to either learn math, or create your own. Either way it is important to be good at it in some form or another.

As long as you can work with values and understand what they are doing, why and what you can make them do, then traditional mathematics may not always be necessary. Occasionally it even gets in the way.

There are alternative ways to visualize a byte's value other than numbers, but they are most definitely the most thought after method. It would be feasible to write a program thinking of all values as colors for instance.

Today's programing derives much of it's value from being able to represent 1s and 0s as different types of data. Even though really those 1s and 0s aren't numbers at all, but electrical wavelength changes, math isn't so much at play as physics,... however,... it is very important in understanding a great great deal of what other programmers say and code.

Still it would be possible to be a good programmer without math, however difficult.

share|improve this answer
1  
Thinking of all values as colors almost makes MORE sense. When you go too far off one end of the spectrum, you wind up on the opposite end... – Maxpm Mar 7 '11 at 8:10
Degrees (as in 0 - 360, except 0 - 256) sometimes helps too =) You don't really need to think in the numerical sense for colors or degrees so much as how 'full' the value is. – Garet Claborn Mar 9 '11 at 4:35

I just finished an intro course to discrete math, and I found that I already knew almost everything about predicate logic thanks to programming; all that was new was the syntax--it was basically just working with booleans.

In short: perhaps you do not have to learn math explicitly, but just by being a programmer you have probably learned some math without realizing. That is, by being a "good programmer", you are also really being a mathematician (to some extent).

The Curry-Howard Correspondence illustrates what I mean: basically, it states that mathematical proofs and certain computer programs are "isomorphic", that is, they are different ways of writing the same thing. Of course, it is actually more complex than this, but I'm not a mathematician, so this is the best explanation I can give. Hopefully it isn't too far off the mark.

In summary, not only do many fields in CS and programming involve a lot of math, but even basic programming ideas (e.g. booleans) are basically math in disguise.

share|improve this answer

Maths is the ante-room of programming.

Being able to work with layers upon layers of abstraction, models, "objectification" of functions, transformations and temporal concepts, maths is the perfect training ground for all that.

It is possible to develop the right mindset to programming without maths but it's a lot harder.

However, specialist areas aside, only understanding maths is important, knowing the name of everything and how a given theorem can be proved isn't. So even if you have good marks in maths because you learned it all without really understanding, you will still struggle with programming.

share|improve this answer

Math knowledge is good for some applications (like gaming, artificial intelligence, computer graphics, etc), but math teach you something beyond just formulas or complex equations.

Learning math is like learning a new programming language. In fact, programming is applied math. When you learn a new language, you learn a lot of things that make you a better programmer. It is not different with math, but if you really master math, you will be a better programmer forever, even you don't use advanced math in your job.

The reason is simple: math teach you to see the world with other eyes. It teaches you to solve problems with different approaches without necessarily programming. This new way to think certainly leds you to a better way to do your job.

Programming is an art. Math is an art. If you combine both of them you will be a better artist.

share|improve this answer

Depends on the math. Not all math is created equal.

I'd say it's pretty hard to be good at programming if you don't understand some basic concepts in Discrete Mathematics like set theory and Boolean logic. Graph Theory and Networks has some pretty obvious applications.

That said, there's a lot of math that is useful to programmers only if it is useful to the problem domain of what you are building software for. It's fairly dependant on the field you are working for, however. I can say I honestly have never cracked a stats book for my work. I'd say Calculus, Statistics, Numerical Analysis, and Linear Algebra all fit into this collection.

And then there's a few caveats:

  • Math is, however, directly relevant to graduating college - I don't know of any school in the country that allows CS majors to pass without at least a year of math. And college diplomas are directly connected to the ease with which you can get a job programming. Also, good GPAs are similarly relevant.
  • I found math of many types EXTREMELY helpful when doing a grad course in Algorithms. Both the algorithms and the methods for analyzing them were extremely math dependant, and from a variety of mathematic topics. As the only math degree holder in the class, I had a serious leg up and the gang who had barely squeaked through math, and who managed to successfully wipe all undergrad math out of their heads had the worse time of it.

That said, I don't do that kind of analysis very often. There's too much chaos in the real world of integration and development to let me get that pure and mathematically perfect on the job.

share|improve this answer
@Job - who said I was a PM? Also... I didn't quite say I liked it. Good at it does not equal liked it. And I was good at it only in a relative sense. – bethlakshmi Mar 7 '11 at 14:53

Well I was having lessons at a math teacher several months ago and I can say that if you have some mathematical knowledge you can benefit from it. For example: I was writing some javascript code and I had to simulate acceleration and deceleration. I heard about the fibonacci sequence from my math teacher so I was able to simulate this behavior easily with it. If I haven't had lessions however I don't know what I would have done. I think the point is obvious from this example.

share|improve this answer

I use to say "No, you don't (necessarily) need to be strong in maths to program".
And I immediately mitigate the sentence..

Pro: As a programmer, I rarely do more math that incrementing variables, doing some operations you do on a desk calculator (+ - * /), sometime go as far as doing a modulus and a percentage...

Con: Actually, you have to apply some branches of math, particularly logic... Some other maths can be useful: concepts around floating point numbers, Boole algebra, theory of sets, etc.
And of course, if you do some graphics, you better know some trigonometry, sometime integration theory, probability, etc.
If you go into functional programming (a domain I discover), you might find it strongly mathematically oriented, with algebraic types, and other algebra theory which can be simple or go to some difficult theoretical highs...

share|improve this answer

From my experience I can tell that there is math and there is other math. If we take a birds eye view at math from the scientific point of view, we will discover that dealing with math requires a high potential of thinking "a logical" way - while following strict rules. This is diffenrent to some other siences - lets say at Arts. So this logical apporach is absolutley mandatory to be a programmer.
Basicly the way you think while programming is very simular to the way you think while dealing with math.
Further there are lots of problems to be solved via math when programming, but this is what I tend to call the "real world math". You can find some examples in the posts above. Also writing a 3D engine is quite complex, the math behind isn't that complex at all. It just requires some structured thinking.
"The other math" is the one you deal with when you (e.g.) study math. There you don't do real world stuff anymore, you focus on more abstact tasks like defining or proving mathematic rules. That materia becomes very complex within a short period of time, but it is not required for your job as programmer.
In other words: you need a basic understanding of math and you should be able to think a structured way, but you do not need "high level" math to be a (good) programmer.

share|improve this answer

The answer to this question is the same as if the question had been "Do we have to learn computer science to program?" Technically no, in that the ability to program doesn't require that you understand how caching works or how databases are fundamentally structured or even how the internet works. However, perhaps it limits what you're capable of programming. It's like thinking you can write poetry because you know english. Knowing how to formulate words to write poetry doesn't mean you can write poetry.

In this sense, you can program without knowing mathematics, though perhaps your inability to perform mathematics would undermine an essentially important skill of a programmer not only for not being able to do the mathematics but also for the ability to logically proof your code which comes only from years of programming experience or having performed proofs in mathematics, for instance.

share|improve this answer

No, no, and a side of no. Math courses help you to develop a method of thinking and problem solving that is useful as a programmer. The actual math however proves entirely unnecessary in most jobs in this industry.

share|improve this answer

You can look through endless source on GITHUB or programming books/tutorials without encountering any maths. A lot of web programming has scarcely got anything to do with algorithms, never mind maths. To be a computer scientist? Perhaps. Just to be a good programmer? No way.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.