It seems that conventional wisdom suggests that good programmers are also good at math. Or that the two are somehow intrinsically linked. Many programming books I have read provide many examples that are solutions to math problems, or are somehow related to math as if these examples are what make sense to most people.

So the question I would like to float is: do you have to be good at math to be a **good** programmer?

- Archives

Yes, of course. They are entirely different.

I know many good programmers, when I say good they know design patterns have degrees from good universities and now work in commerce (finance sector). And have a number of large released successful products. They know A-level maths I would say (a-level is exam you take when you are 18 in uk, generally).

It may be somewhat unusual to be a good programmer and not be interested maths. But I think a lot of people are prejudice in thinking one must like/be good at both. They are not dependent on one another.

- Archives

A *good* one? Very unlikely. Most design patterns have at least some basis in mathematical concepts. Things that are essential to programming, like variables, loops, procedures, and objects, are analogues to concepts in mathematical fields like algebra, calculus, and set theory.

Consider also that computer science is a subset of mathematics: algorithms and formal logic, upon which all programming is based, are fundamentally mathematics.

If you hate math, you're going to *hate* programming.

- Archives

Maybe, most programming jobs are about plumbing stuff together. You could be a good programmer in that field.

- Archives

I think it is possible. I personally know someone who sucks at math and as I know is a pretty good programmer.

However IMHO programming has a relation to discrete math and being good at that does help you in your programming.

But being able to integrate and differentiate and that kind of math is not really relevant, while that is where most people have problems with math.

- Archives

I don't like math and I always got low math grades. I don't want to say that I'm a good programmer, however I'm in the software industry for 10 years with great success.

- Archives

There are many different fields of programming and many of those don't require a particularly high standard of mathematical knowledge. You will never be able to write a 3D engine, but you will certainly be able to develop business and web applications. Let's face it - the most common mathematical operation in most computer programmes is incrementing a number by one.

I'll quite happily admit I've never particularly liked maths or been good at it (I actually graduated with a degree in English Literature!) and have worked as a professional developer for over 12 years now. I develop mostly web applications, which rarely require that much maths. More important is the ability to think logically, be able to break problems down into chunks and have a wide understanding of the various technologies and frameworks involved.

As a programmer you are much more likely to have to implement an *existing* algorithm than devise an entirely *new* one. Need to work out, say, compound interest? You don't need to figure it out yourself, just look-up the formula and apply it. Most of the problems have already been solved, you just need to know how to implement the solutions in your language of choice. That's not to say that being good at maths wouldn't be an *advantage*; it's just that it isn't totally *essential*.

When I was at school in the mid 80's when home computers where not very common I often wrote programs to solve my maths homework. I often couldn't do it in my head, but I could apply whatever formula was required as a software routine. You don't need to be another Pythagoras to work out the longest side of a right-angled triangle, you simply need to be able to code up `aÂ² + bÂ² = hÂ²`

in your language of choice.

- Archives

Can you become a good software developer without maths? Yes, I think so. Can you become the sort of heroic programmer that people talk about all the time? I think not.

The problem is, most, if not all, heroic programmers (think Dennis Ritchie), have computer science or maths backgrounds. To become a truly great programmer, you need to understand algorithms at a level that's more than just superficial, which means you're forced to delve into formal computer science. And computer science is just applied maths.

Similarly, an understanding of lambda calculus would be invaluable to an OS architect or a language designer.

- Archives

I think it's important to look closely at why you don't like maths.

A dislike of an academic discipline is usually something that happens at school, and may be down to a conflict of some sort or another with a teacher, lack of confidence in your own ability within a subject, or peer group pressure.

Programming != maths. It doesn't even "feel" like maths, for me (and I enjoyed maths, despite not doing so well towards the end of my formal studies in it). Many skills that you might use in maths are useful, necessary even in programming, but many programmers teach themselves for the most part. Not liking maths in school has pretty much zero bearing on your ability or enjoyment of programming.

- Archives

"Like" and "be competent at" are entirely different things - so as long as you are properly numerate then I can't see a reason why you would *have* to like maths.

But lets be absolutely clear here - programming has a strong basis in maths and sooner or later almost any non-trivial development is going to involve calculations - you can't hide from this.

Any programming involves logic (basis in maths), most modern programming probably involves things (like SQL) that involve set theory (even if its not obvious) and if it doesn't then it may well be the case that you're off in realms (like games programming) that are even more explicitly maths based (rendering - maths, AI -> probability and randomness - maths...) and so it goes on.

The upshot of the above is that you have to be comfortable with numbers - you certainly have to get why "There are 10 types of people in the world, those who understand binary and those who don't" is funny. But you're probably excused "2 + 2 = 5... for very large values of 2".

- Archives

No, as long as you are talking about math apptitude and not grades and include all subjects: logic, algegra, geometry, trig. I did much better in geometry than algebra because I think I understand things 'spacially' and my teacher did not require any memorization which is good because I have none. Probably why I like working with databases.

Also, it may have depended on your school system's math curriculum. Doing nothing but computations and memorization would have put me off.

- Archives

I have seen this topic argued back and forth. I have worked with people who had degrees in mathematics that thought they could progam and within a year or two changed careers. One of the best programmers I ever had the pleasure to work with had a Ph.D in Biochemistry and never took a formal programming/CS class in school but self-taught himself and started a successful software company!

Ultimately, what makes a good to great programmer is someone who is capable of understanding logic, workflows, can learn by example and willing to research for a solution. Also, you HAVE TO LEARN THE BUSINESS your applications are for. I hate programmers who are pround they don't understand accounting, yet write accountting applications. They always make incorrect assumptions and really slow down development.

You will find, no matter what school you go to, you will learn more in one year out of school than you did in 4 years of school. School teaches you how to learn with basic skill set - but real world experience is so much more valuable over time.

Experience is the best teacher and when you have to apply mathematics in to software development, as long as you learn the business - you will be fine. Also, remember, as an earlier post said, unless you are trying to work on a 3D graphics engine or graphic coordinate systems like GIS application, math you learned through high school is all you really need.

I've worked on Accounting and Billing systems - and I never had to figure out Log(x), SIN, COS, etc for handling a general ledger or allowing data entry. An Aging Journal is not "high mathematics" but critical to evaluating AP issues.

Come to think about it, I've never meet an accountant with a scientific calculator on their desk!

- Archives

It's more about problem solving. How much do you like solving story problems? Or maybe how much do you like fixing things? Do you give up quickly or spend all day trying to put your $5.00 headphones back together?

- Archives

I have always considered programming to be nothing *but* mathematics.

It just doesn't look like high school algebra.

- Archives

Nice try. You already know the answer if you're asking. Stop avoiding math and get a good foundation, otherwise prepare for a life of having this issue repeatedly haunt you...

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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...

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

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.

- Archives

Yes. Because most of the people who doesn't like math, think about theorical, formula math, instead of applied math to real world. Most of the programmers are not mathematicians, and still, use a lot of math, and it comes naturally.

For example, there are several math subcategories / branches, very specifical to programming. Automatons & Grammars & DFA, for programming language & compiler design. Relational Algebra & Relational Calculus for Databases. Boolean Algebra for conditions in programming.

In University, I watched that architects students didn't struggle with calculus, as others students did, because they applied all the time, to real world stuff. I see the same for math, for programmers.

- Archives

I have not found in practice that programmers need to be mathematically inclined to become great software developers.

Jeff Atwood - creator of this and all other stackexchange sites (the guy is a brilliant programmer).

- Archives

Math is not one "thing". It's a large subject area with many components, a huge portion of which most programmers can an do forget in their professional careers (e.g. not every programmer creates statistical data mining, DSP, 3D, and aerodynamics modeling software, etc.)

Furthermore, one doesn't have to like math to be good at it, or good at just the portions required for most programming tasks.

I could easily see hiring an enthusiastic puzzle solver who never took calculus over someone who aced diffEQ but hated any kind of logic puzzle.

- Archives

As aforementioned, math is thought to be important to be a good programmer. Does that mean, just learning formulas make you a good programmer?

Per my experience it is the ability to observe situations, and decide based on the observation that is needed: you see a case and pose a question about it. And look for answers to solve it. If you can break it into parts as means of solution it is the better. But it is still in the realm of logic.

The ability to think logically, and looking at problem with the attitude of solving it is very rare in society... in terms of percentage. Even between smart and intelligent people there are ones that perceive faster or slower.

Math happens to be a field that people don't understand and hold confusing. While the logic people using their reasoning "work with it" until they understand it. Therefore often the ones not having understood math, tend to associate the two fields with each other. While they are not.

Being able to observe and decide can make you also a good leader, a good cook, and so on. But it is eventually your decision and motivation that makes you a programmer.

- Archives

I think it's a matter of how much math.

I can't imagine being a good programmer if you're not very comfortable with algebra. However, there is little need for math beyond this. I've never used anything beyond basic calculus and that only very rarely. I've used a moderate amount of trigonometry but that was almost entirely due to work on CAD/CAM stuff.

- Archives

No. You do need to be good at logic though, which isn't exactly the same thing. Me, I'm great with the logic, but the numbers generally throw me for a loop. I can work it out, but it takes me longer to do the mathy bits.

- Archives

The short answer is no. I think it's a bit of a myth but it's propogated because maths problems are usually well suited to being solved by computers.

So in uni/college, people will get maths problems that they need to solve in compsci subjects but what you will usually find is that the maths is actually harder to solve than the code that is needed to implement the solution.

Once you get into the real world, you'll increasingly find that the problems are largely solved for you, your job will just be to implement them in code.

- Archives

I think it depends on what type of programming you want to do. As far as being a programmer in the business world goes, I would say that the answer is no. You can become a great programmer without knowing advanced mathematics. When you do end up having to deal with math, the formulas are usually defined in the business requirements so it only becomes a matter of implementing them in code.

On the flip side, If you want to become a low-level programmer or say create 3D graphics engines, mathematics will play a huge role.

- Archives

It somewhat depends on what exactly you are doing, though it definitely can't hurt.

For example, someone who majored in Computer Science has got to go through a lot of math to get their degree. CS generally focuses a lot on algorithms and their correctness, proven through high-level math-style proofs. Many Universitie's CS programs are so close to their math program that a double major is only a few courses away. Even as a Software Engineering major, myself, I was 2 courses away from a Math minor.

However, that being said, a lot of the proofs, data structures, search methods, and algorithm correctness stuff that I learned hasn't really been put to direct use since I finished school. But it would be hard for me to say that it didn't at least give me a good foundation and better understanding of what I do at a low level.

Because no matter how you look at it, at the lowest level, everything you are doing boils down to math.

- Archives

Depends. Enterprise CRUD (Create, Read, Update Delete) apps usually don't need exceptional math skill. On the other hand if you are designing algorithms a background in math will help and in many cases be necessary.

- Archives

I think it obviously depends on what sort of programming you're talking about.

If you want to write the rendering engine for a video game, you're going to need stellar math ability to have any hope. If you want to develop data structures and sorting algorithms, math is very important.

If you want to develop websites and line of business applications, complex math really does not come into play that often (excluding the problem domain).

Either way, I think the most important thing is that it's never too late to learn.

- Archives

No.

Much like most science disciplines, having a good understanding of maths concepts is going to be helpful, particularly when evaluating things like efficiency. But for most programming tasks your maths ability is only relevant if the problem you're solving is related to maths.

Computers are excellent at doing mathematics, so it makes sense that early computers were used extensively to do the 'grunt work' associated with a lot of complex maths work. A lot of software still **does** solve complex maths problems, in that case being good at maths will help you write a better program, but it's not what makes you a good programmer.

- Archives

Usually, not in the sense that you need to know, say, calculus or trig equations to do most work. If you're doing heavy graphics/game programming, then yes. A famous math hack for Quake is a good example of this. However, the thinking that you have to get into while dealing with higher-level math certainly is applicable to programming; with programming, you are developing your own logic structure, your own functions, your own "proofs."

The only time I've run across math in my job (internal enterprise workflow and apps) is when I do some reporting apps that require knowledge of statistics, but that's only because it was directly applicable to requirements.

- Archives

You don't have to be good at math. However, you have to be good at logic, and problem solving. However people who are good at logic and problem solving are usually good at math also. I would say that it really depends on the type of math. You can be terrible at calculus (like me), and still be a good programmer (like me). But if you have trouble with Discrete Math and Set Theory, you would probably find a lot of aspects of programming quite hard.

- Archives

Ditto Tim. There are some areas, like 3D graphics, where you'll want to understand, for example, physics, but for the most part you can get by with just arithmetic and some simple algebra.

- Archives

This is a very hard question to answer and will likely stir up a lot of debate.

One of the reasons why this question is so hard is that it partly depends upon what type of work you are doing. There is not a lot of math involved with most business applications, so you can get by with a solid understanding of algebra and business math. However, more advanced applications call for more advanced math and you start needing a solid understanding of calculus, linear algebra, and the like.

However, that is just one part of the equation in that you still need a certain degree of mathematics for just the practice of programming itself. It goes without saying that you need to be comfortable with logic to just be able to write a basic program as well as basic algebra. Looking a bit beyond just getting a basic program working though you need to have an understanding of certain aspects of discrete mathematics to be able to make determination as to what makes for a good algorithm to use for a given problem.

To get back to the heart of the question though. I personally don't think you need to be a mathematician to be a good programmer; however, I do think that you need to be comfortable with math to be able to be a good generalist programmer.

- Archives

I would say not necessarily. Certain programming disciplines (crypto, graphics, physics engines etc) would definitely have a clear advantage for the mathematically inclined, but I don't think a good understanding of differential equations would be particularly useful for web programming for instance.

Boolean logic is probably a requirement to be a good programmer, but it wouldn't surprise me if a lot of people who didn't achieve good marks in high school maths turn out to be good at programming.

- Archives

Not maths as such, but arithmetic comes into play a lot.

Unless the application you're writing is heavily mathsey, then you don't need it to be a good programmer. If you're just starting out and want to get into games or graphics programming, then that can often be quite maths oriented.

- Archives

I would say you definitely don't need to be good at math to be a good programmer.

My first job as a programmer was doing 3D graphics for B-52 and Cruise Missile mission planning. It was a math intensive application, but I really only needed access to people that were good/great in math. I didn't need to know the formula for computing great circle distances between two points. I did need to know how to convert the formula so that it worked in a programming language. The same with flight simulation. Boeing did all the math we just had to apply it.

That experience also helped me get a sense of who would be a good programmer and who wouldn't. The job had pilots and navigators taking a tour of duty as programmers and to help the programmers understand the needs of the mission. You could usually tell within a few weeks what pilots and navigators would be good at it. Math majors usually took to programming right away.

So I would say being good at math makes it more likely you will be good at programming, but I know a lot of good programmers that aren't so good at math.

- Archives

Almost everybody has answered: "do you need to know math to be a good programmer?" The correct answer to this is: "No, not really, but it helps," as many have already said.

But my interpretation of the question is "is there a strong correlation between mathematical aptitude and programming aptitude?" The correct answer to this is: "Yes, there is." If you struggle through algebra, geometry, and calculus, then you probably aren't very good at dealing with abstractions and/or thinking logically. If you're bad at math, you probably won't ever be a great programmer. (Not that you shouldn't try.)

- Archives

I disagree fairly strongly with Daniel (to a point). To be a capable with the programming languages, api's and tools that you use, it strong math skills aren't necessarily required. However, if your goal is to go beyond the level of coding to other people's specifications being able to apply math and more complex algorithms to a problem (I consider these to be very similar) will take you a long way toward that goal.

Now for the why. In my experience, it's usually not hard to come up with programming solutions to many propblems that meet the requirement of producing the required output and keeping to a few restrictions. Where the math will really help you is when you have to take an existing solution and make drastic improvements to it. For example, if you need to write you own text comparison code, it isn't hard to use the search text to generate a simple regex to account for some spelling differences, but if you want to be able to emulate the behavior of Google Suggest, you need to understand algorithms like Soundex, Levenstein Distance and others. For a more mathamatical problem, consider a cache for keeping commonly used objects in memory instead of hitting the DB every time. How can you generate hash values in such a way that two objects with trivial differences have the same hash value?

At the end of the day though, the type and amount of math you need really depends on the field you're in. If you working with computer graphics, strong calculus and algebra skills are pretty important, but developers of financial software can probably get manage without. On the other hand, in any application where you have to deal with floating point arithmetic, having a strong understanding of number theory is a necessity, otherwise you'll constantly be faced with running totals that no longer add up correctly (due to rounding, truncation, and number representation issues).

- Archives

Yes, definitely.

Even run of the mill business programing requires some skill at math.

Run of the mill business programing requires database skills. Being a good database programmer requires an understanding of how databases work, and what the algorithms are that the query processor uses when it translates your queries. Without an understanding of limits and derivatives (or even the basic understanding that the line y = x intersects the line y = x^2 twice), it is not feasible to accurately compare a hash-match inner join query plan vs a nested loop join query plan.

Also, a good programmer can work in just about any domain, provided that they study up a bit: games, simulation, embedded development, compilers, operating systems, web stuff, databases, etc. Being able to do all those things (or more accurately being able to quickly learn how to do all those things) requires a decent amount of mathematics background.

I'd say that one should have had some experience at some point in time with the following:

- 3 Semesters of Calc
- Diff Eq
- Linear Algebra
- Modern Algebra
- Basic probability,counting, and statistics

- Archives

I'm going against the grain and saying **yes, you need a math mindset**. Most people think of math as doing arithmetic or memorizing arcane formulas. This is like asking if you need perfect spelling or an extraordinary vocabulary to be a good writer.

Writing is about communication, and math/programming is about the process of clear, logical thinking (in a way that you can't make mistakes; the equation doesn't balance, or the program doesn't compile). Specifically, that logical thinking manifests in:

- Ability to estimate / understand differences between numbers: O(n^2) vs O(lg(n)), intuitive sense of KB vs MB vs GB, how slow disk is compared to RAM. If you don't realize how tiny a KB is compared to a GB you'll be wasting time optimizing things that don't matter.
- Functions / functional programming (is it any coincidence that the equation f(x) = x^2 is so similar to how you'd write that method? The words "algorithm" and "function" were around in the math world far before the first computer was born :-))
- Basic algebra to create & reorder your own equations, take averages, basic stats

So, I'll say you need a math mindset, being able to construct & manipulate mental models of what your program is doing, rather than a collection of facts & theorems. Certain fields like graphics or databases will have certain facts you need also, but to me that's not the essence of being "good at math".

- Archives

I found an interesting article and ensuing discussion regarding this question:

- Archives

The fundamental concept of maths is the following, devising, understanding, implementation, and use of algorithms. If you cannot do maths then it is because you cannot do these things, and if you cannot do these things then you cannot be an effective programmer.

Common programming tasks might not need any specific mathematical knowledge (e.g. you probably won't need vector algebra and calculus unless you're doing tasks like 3D graphics or physics simulations, for example), but the underlying skillsets are identical, and lack of ability in one domain will be matched by a corresponding lack of ability in the other domain.

- Archives

I say this as someone who is neither great at math nor necessarily a remarkable programmer, so perhaps you can take my opinion with a little grain of salt.

When you know continuous and/or discrete math a bit better, you'll find that problems you encounter benefit from that knowledge. Similarly, when you at least understand how algorithms like breadth first search work, you'll discover applications for that more readily than before you understood it. Some problems that seem intractable when you only know about simple data structures like arrays and linked lists suddenly seem relatively simple when you understand a little bit about graph problems.

The point is, almost all kinds of knowledge will make you a better programmer.

I'm not sure that the inverse is true: that you MUST be good at math to be a good programmer. But I suspect that the difference between good and great may be a question of math skills.

Steve Yegge's blog has at least one argument in favor of shoring up one's math skills. It's an interesting read.

Basically, almost any kind of domain-specific expertise can be useful as a programmer. I probably wouldn't be in this industry had it not been for my German and Japanese skills; it was a question of right place, right time, right foundation. I suspect knowing even trivia-level details about biology (ant colony optimization?) can open your eyes to more ways of solving problems.

- Archives

Pretty much repeating what everyone else has said. The more graphics you are doing the more math you will need. 3D stuff gets kinda hairy with the trig and matrix stuff, but like everything else, you learn the idioms and you're good to go

- Archives

Math is more than just formulas. Understanding some mathematical principles about set theory is very useful to grasping complex concepts on type systems, as is understanding complexity a paramount to efficient data structure usages.

Graph theory is also extremely useful, as many programming problems can be modelled by a graph. I was very astonished, as I was developing a business application, to find out that the shortest path theorems were providing an elegant solution to a thorny problem that I had!

- Archives

**Short answer:** It depends on what kind of programming you're doing.

**Longer answer:** If you mean specific mathematics courses that you do, then it very much depends on what kind of programming you're doing. Some kinds will be useful to all programmers (see *Concrete Mathematics* by Graham, Knuth and Patashnik, for example), whereas some can get by without using, say complex analysis (which I have used in programming).

More generally, the kind of logical thinking that mathematics needs, particularly in finding flaws in bogus proofs (e.g. that 1=0) hones the kind of thinking needed in debugging.

**Personal suggestions:**

**Essential:**

- Calculus - general purpose. More advanced courses in it may be useful (e.g. complex analysis is used in electronic engineering).
- Statistics - general use, have used it personally in my career.
- Logic - converting logical expressions into equivalent but simpler expressions, checking the validity/nonvalidity of a proof.
- Computability theory - see proof of Halting Problem being unsolvable for Turing machines - you may find yourself trying to solve something equivalent to it some day, then rewrite the code to solve a possible task, depending on the domain.

- Archives

I am pretty bad at general math. However I am very very good at logic and problem solving.

It helps that I started programming BASIC when I was like age 10 though.

I consider myself to be a "good" programmer. I know however that I will probably never write a 3D engine or face recognition algorithm or anything like it. And that is the key. Everyone has limitations. I know there are certain areas in software that I will never be able to go. But likewise those people that are exceptionally good at math aren't always the best software engineers/architects either.

Just last week we interviewed a guy that could probably write you a face recog' algorithm in the space of a week. However he knew nothing about design patterns or architecture. Nor did he display any interest in them at all.

So no. I don't think you need to be "good" at math in order to be a "good" developer. There are many different types of developer.

- Archives

If you are not very good at math then your answer will undoubtedly be "no, math skills are not required". If you are one of the small percentage of people that actually know math and use it everyday, then you realize how valuable your math skills are and how they enable you to quickly develop routines. You will not spend countless hours debugging using trial and error methods. Your functions and classes will be "reduced" allowing for more complex functionality. Given enough time and motivation, anyone can program. Will the code that person writes be any good?? I guess if it works, right?

Bottom line. A programmer with good math skills will be a far better programmer than the one who lacks. They will be much more productive and will save the company oodles of money in development costs, both in the present and future when the application needs to be expanded upon.

The most basic program is an exercise in Algebra. If a programmer does not recognize this, the result is code that is not reusable. You get lots of repetitive "almost the same" code. Another word for this type of programming is "non-scalable"!

- Archives

First in trying to come up with a meaningful answer to that question it should first be acknowledged that mathematics and computer science as subjects are both large and diverse in terms of the concepts that they cover. One common thread that unites the two are that they both deal with abstract concepts. An ability to deal with abstract concepts would imply that some areas of both Mathematics and Computer Science should be accessible to you. Put another way, a situation where someone is able to write programs but not solve any maths problem or where someone can solve maths problems but is unable to grasp any aspects of programming both seem implausible. A fairly basic abstract concept that human brains are generally able to comprehend and one that a fairly major component of both subject is numbers. Above and beyond your ability to understand numbers. the extent of your natural talent for wrestling with abstract concepts with determine the complexity and variety of the mathematics or algorithms you are able to understand.

Beyond natural talent however both solving maths problems and programming both require enormous amounts of dedication, practice and study to become proficient. So if you have an agile brain and commitment you probably have the potential to be good at either. However having the potential to be good at something and actually being good at something are usually determine by confidence which is a different beast entirely.

Plenty of good programmers get nervous when confronted with too many equations. This is usually more due to a combination of not having invested the same amount of time and previous bad experiences which leads to a lack of confidence rather than an inability to understand them.

- Archives

To be good at programming you can be good at math, however the two disciplines are completely unrelated to each other. The people with the highest aptitude for programming are people who are also gifted in the compositional arts such as music, painting, writing, film or theater directing or even choreography.

In the 1960's an insurance company did a study to find out who they should hire to train to program their mainframes (as computer science as a college major did not exist yet). They found that musicians and English teachers made the best programmers (in that order).

I've been working professionally as a software developer since 1982. And indeed the best programmers were those people who were good at music, in particular composition and arranging. The very worst programmers I ever worked with had PhD's in math. I've worked with two such people and they had zero knack for programming.

I was always good at math, but I'm also a musician, composer and writer. It is these latter talents that allow me to be a good programmer.

- Archives

Is it possible for people who don't like math to become a good programmer?

No, no-no, no, yes and no!

No, because often you need it.

```
(! (a | (! (b && c) || d) && (! e)))
```

Why doesn't it work?

```
foo ('a', 'b', 19, g(h))
bar ('c', 'd', 44)
```

can it be rewritten in a more abstract way?

Is 968 ms more or less than 0.7 s? How many MB do you need, how many Ghz does the machine have, will a byte be enough - math is everyday part of the job. Sometimes explicitly and higher math.

Always implicitly lower math.

Math is a wide field, from calculating, to matrix, to geometry, logic, statistic, category theory, graph theory. So if you believe you're programming without using math - maybe you're wrong.

If you look at problems at the Project Euler page, you will find puzzles, where I don't have an idea, how math is used to solve it. (Not that I could solve them without math.) Note that the problem size is normally that big, that you can't solve them with brute force.

However - since I can't solve lot of them (about 2/3 by now), does it mean that I don't like math?

If you didn't study math, you will probably not know, where you can find math your daily life, including programming.

Even if you just specialised in moving GUI-components on the screen to look good, you're doing math in some way.

- Archives

**For me, it was the other way around**

because i liked programming, i was good at math, because for most concepts, i had a practical application, starting simple with logic (x and y or z), to simpler analysis ("ok, f(x) is a function. i know that, that even looks exactly like the functions in Pascal. go on"), to higher stuff (a mapping |R -> |R? ah, thats like a Dictionary with floats as keys and values).

I was often surprised, that math was not just not that hard, but instead provided me a much easier way of thinking about my programming problems than those clumsy, pragmatic languages i was coding in ever could.

- Archives

It does depend on what you want to do. You to need know American high school math at least. Trig, logs, etc. If you can't solve the problem "Mark can mow the lawn in 2.63 hours and Mary can mow the lawn in 1.87 hours, how long will it take to mow the lawn if Mark and Mary work together?" I don't think you could do much programming.

Also, what is math? Is converting from decimal to binary to octal to hex math? You can find calculators to do that easily. I think a programmer should be able to convert 49 to base 7 rather quickly.

- Archives

I think math would help. I have an undergraduate in applied math and a master's in MIS. I did get an MBA sequentially - but for the most part what has helped me stay in the IT field, most of which has been a developer (database and datatwarehouse programming), was the math.

I see computer programming as a "logical math" - but then again I see math as a language. As someone earlier stated, it helps in communicating complex ideas. The first programmers were actually mathematicians and engineers. A lot of people I know who are great programmers have an engineering degree.

If you want to be a programmer/analyst, math will help. It's the logic set necessary, and the discipline. I see relational databases as more of linear algebra anyway. There is a great paper on "Fast Monte Carlo Algorithms for Matrices: Approximating Matrix Multiplication". It is math-based.

Computer Science Majors are often part of the Mathematical Sciences Dept. at Universities. There is a reason for that.

Ultimately, there's not a "one size fits all" approach. I think they are a good compliment to one another - math and computers.

The most fundamental attribute for being a great computer programmer is being able to solve puzzles. There's always some bit of information missing, or information that is ambiguous.

Ask yourself this: "Would you rather have a 10,000 piece jigsaw puzzle with all the pieces there and no picture on the box to guide you, or would you rather have the same jigsaw puzzle with the picture on the box and have 10 pieces missing?"

I hope this helps !

- Archives

Mathematics is an abstract notation for modeling real world situations, and this is exactly what programming is.

If you can't visualize and figure out how to build an accurate working model of the world then you won't be a good programmer (or mathematician), and there's no getting around that. That said you could probably pound out some JavaScript and Bash and make a fine living at it without knowledge of advanced mathematics, but I assure you knowing math will only add to your ability to think abstractly and create better models.

Learning to be a good programmer is a ton of work, and I suggest that you simply consider learning mathematics to be a part of that workload because it can be the difference between being a fantastic programmer and merely being a competent one.

- Archives

Not all maths are about crunching numbers. Anyone who can program is good at math relevant to programming. Remember: Mathematics is the study of patterns!

- Archives

I think it depends on what type of programming you want to do. As far as being a programmer in the business world goes, I would say that the answer is no. You can become a great programmer without knowing advanced mathematics. When you do end up having to deal with math, the formulas are usually defined in the business requirements so it only becomes a matter of implementing them in code.

On the flip side, If you want to become a low-level programmer or say create 3D graphics engines, mathematics will play a huge role.

- XiaYe

I'm going against the grain and saying yes, you need a math mindset. Most people think of math as doing arithmetic or memorizing arcane formulas. This is like asking if you need perfect spelling or an extraordinary vocabulary to be a good writer.

Writing is about communication, and math/programming is about the process of clear, logical thinking (in a way that you can't make mistakes; the equation doesn't balance, or the program doesn't compile). Specifically, that logical thinking manifests in:

Ability to estimate / understand differences between numbers: O(n^2) vs O(lg(n)), intuitive sense of KB vs MB vs GB, how slow disk is compared to RAM. If you don't realize how tiny a KB is compared to a GB you'll be wasting time optimizing things that don't matter. Functions / functional programming (is it any coincidence that the equation f(x) = x^2 is so similar to how you'd write that method? The words "algorithm" and "function" were around in the math world far before the first computer was born :-)) Basic algebra to create & reorder your own equations, take averages, basic stats So, I'll say you need a math mindset, being able to construct & manipulate mental models of what your program is doing, rather than a collection of facts & theorems. Certain fields like graphics or databases will have certain facts you need also, but to me that's not the essence of being "good at math".

- Bjergsen