How important is Maths for Programming

Sigh.. and I'm the one with weak mathematics here.

Your search: 20,973 results.

"Java" search: 688,255 results.

(20,973 / 688,255) * 100 = 0.03047271723416466280666322801868 (yes, that's three percent) of all Java threads on Stackoverflow contain the word "Optimization".

That's not a lot now really, is it?

And that is completely irrelevant, not least the data doesn't support your hypothesis in the slightest.

Your hypothesis is that no one should ever care about performance ever, which is blatantly wrong. The actual ratio of programmers that need to care vs dont need to care is irrelevant. No one has said anything about the ratio.
 
I've already linked a few developers to this thread (including someone at Nvidia, so no need to whip out that they're crappy or something) and they've been laughing at some of the stuff said here, and commented on how over the top D.P is (I'm not the one who said he was a smarty-pants overly complicated programmer, they did). They also play down how much maths is needed, contrary to D.Ps assertion. Something like "Unless you're making something specifically heavily maths dependent, like a game engine, the amount of maths you're going to need to know or come across is very little. Sure, to understand the precise logic behind everything you're doing helps, but in by no means is it any kind of requirement to being a good programmer." Basically D.P, you're not wrong, you're just being over the top in how important it is to the average programmer.

The point is, stop scaring people looking to get into programming. For most, non specific cases the amount you need to know is very little and that is fact. Abstraction only helps with that.

But hey, what do I know? :p

over the top is ridiculous. I've barely made any assertions to the level of maths required, just point out that you end up using math with surprising frequency.

I've repeatably pointed out some every day mundane examples like drawing arrows on Google or helping boss know when the number of users have changed. This isn't rocket science, this is the kind of things you might come across in any programming job.


And your appeal to authority bounces right off me. I have 20 years experience, a PhD in Computer Science, command a 6 figure salary, are the lead developer and of a high tech start up working directly with multinationals.

It is very clear some people cant even read plain English let alone program! Funny how I never said anything about the level of maths needed (did I say you need a degree, heck GCES is probably more than needed for most), nor did I ever say that you have to write optimal code, only effective code that is appropriately fast for the application.
 
Last edited:
And that is completely irrelevant, not least the data doesn't support your hypothesis in the slightest.

Your hypothesis is that no one should ever care about performance ever, which is blatantly wrong. The actual ratio of programmers that need to care vs dont need to care is irrelevant. No one has said anything about the ratio.

You need to read the thread again.
 
And your appeal to authority bounces right off me. I have 20 years experience, a PhD in Computer Science, command a 6 figure salary, are the lead developer and of a high tech start up working directly with multinationals.

Which tells me all I need to know.


I'll point out my example yet again - I just wanted a very basic website that used Google maps API and displayed some arrows at various landmarks. To draw those arrows required rotations, linear algebra, line intersection tests nd a Haversine distance function.

"I just used CSS transforms but I'm trying to sound smart about it" is my problem with what you say. Stop making it sound more complicated than it is. You make it sound like you created all this stuff yourself when all you did was used stuff built into the language already which you don't need to understand, only how to use it. Two completely different things.

So as I said, you're not wrong. You're just trying to sound way too smart about it, something I'm not surprised about given your credentials. You may as well as argue that you need to learn electrical engineering and circuit design or else you don't understand the hardware well enough to use it.
 
Last edited:
I think people are a bit too focused on whether they program to do mathematical things, are thinking of maths in terms of applied maths, numerical methods, optimization. You don't have to be applying programming to a mathematical domain for programming to be related to maths - program itself has its foundations in mathematical logic. Programing basically is maths.
 
I think people are a bit too focused on whether they program to do mathematical things, are thinking of maths in terms of applied maths, numerical methods, optimization. You don't have to be applying programming to a mathematical domain for programming to be related to maths - program itself has its foundations in mathematical logic. Programing basically is maths.

But that's not the question the OP was asking: they were asking about whether you need mathematical skills - of the kind taught in school - to be a good programmer.

Whether you can describe programming mathematically is really neither here nor there when it comes to answering that question.
 
But that's not the question the OP was asking: they were asking about whether you need mathematical skills - of the kind taught in school - to be a good programmer.

Whether you can describe programming mathematically is really neither here nor there when it comes to answering that question.

not quite he's stated that he's seen adverts for both jobs and courses requiring mathematics and then asks:

Do you think maths is a large part of programming?

If Yes - why and how does it come in?

If No - why do loads of adverts mention it?

my answer fits the first question - certainly as far as courses are concerned - fundamentals of computer science etc..

though as far as the followup questions - the various answers in the thread also highlight areas for the second one

and to the third question - if we're just looking at a subset of maths and saying that that part isn't directly relevant so answer 'no' to the question then we can still put forth the idea that solving problems in an abstract domain etc.. is still useful in general as far as programming is concerned
 
It depends entirely on what's being programmed.

At work I use Visual Studio almost exclusively for the (mediocre) coding I do for small business applications. Then as part of the empirical analysis for my dissertation I used R and some freely available libraries to build some econometric modelling tools and piped the data between the application and an SQL server doing historical analysis over the entire time series. The maths was fairly advanced but doing it programmatically meant I could carry out monsterous amounts of data crunching with relative speed & ease. It turned something which would have taken more than a lifetime to achieve by hand into a 48 hour number crunching exercise. It's crazy to think how freely available these tools are and how little they cost.

As for the Java debate; in part of my degree I interviewed quant guys up in the city and 3 of the 4 have migrated over to Java away from C / C++ for two reasons: 1) The JVM today is orders of magnitude quicker than the JVM of 5 - 10 years ago, It's way more robust, it's fast enough and doesn't take as long to debug, 2) The way Java manages memory doesn't matter so much any more because getting 100s of GBs of RAM is not expensive any more, relatively speaking. The flexibility it affords is so much more valuable than being 'efficient'.

So the answer is: If you want to program things that rely on maths, then you need to know the maths for the problem you're approaching. If you want to program applications and make shiny GUIs, it's not so important. IDEs are very mature these days and so easy to work with. However learning to properly comment and structure your code is arguably more valuable if you end up working on a project with more than 3 people involved. Then there are problems which are more related to the topic of computer science (race conditions, etc) which is a whole other discipline on it's own. Do whatever you're interested in and you'll make some money, no worries.
 
Last edited:
When hobby-programming, I wrote an ATM system complete with Pin Codes and interest payments, overdraft payments, penalties and credit cards linked to the 'account'. Obviously used maths here but very very elementary.

Also wrote a program to be used for a car rental company. C# on top of a SQL database. No maths needed. No deep thought needed either.

Then a movie booking system where I suppose graphics programming could've come in handy to simulate seats. From memory, I made my 'seats' radio buttons and just saved it as 'occupied' to a SQL database when selected. No maths again.

You can do a lot without maths.
 
Are you for real?

Speed is important when ever you are programming some thing that has performance requirements, which is a large area of software.

Anyway are you saying that if you had a Address book of millions of names and addresses you would choose a vector or list and just iterate over millions of records because you don't care about performance, rather than choose a set or hash map (or other structure) to find entries effectively?

If the former then Intel must love programmers like you.

Yes, programmers use libraries, e.g. The programmer creating the Address book app can use a container library (or native libraries) and must choose what data structure they are going to use.


well said. for a list of million of record, id find the commono dinomitor of the data structure and use a hashmap to store it efficiently
 
As for the Java debate; in part of my degree I interviewed quant guys up in the city and 3 of the 4 have migrated over to Java away from C / C++ for two reasons: 1) The JVM today is orders of magnitude quicker than the JVM of 5 - 10 years ago, It's way more robust, it's fast enough and doesn't take as long to debug, 2) The way Java manages memory doesn't matter so much any more because getting 100s of GBs of RAM is not expensive any more, relatively speaking. The flexibility it affords is so much more valuable than being 'efficient'.

This is exactly why I hate many of the applications I use, especially Java. The arrogant assumption that it's not worth writing efficient code because hardware is cheap. Here's the news - the vast majority of business computers are over 3 years old and minimum spec, not 64bit Core i5 with 8GB ram
 
This is exactly why I hate many of the applications I use, especially Java. The arrogant assumption that it's not worth writing efficient code because hardware is cheap. Here's the news - the vast majority of business computers are over 3 years old and minimum spec, not 64bit Core i5 with 8GB ram

It's not an arrogant assumption, it's just fact. Programmers don't try to make their code inefficient, but they also have to work within budgets and time frames. You simply don't have the time to go back and make things work better unless it is causing a major performance issue.

Are you a hobbyist programmer? It's easy to be a perfectionist when you're not on a budget.
 
Why is everyone so certain there is only one correct answer ? There can be many different opinions all with a degree of truth about them. Instead of crisp sets try thinking fuzzy sets :)
 
well said. for a list of million of record, id find the commono dinomitor of the data structure and use a hashmap to store it efficiently

Exactly, this isn't rocket science, just every day programming.

Programming languages come with a large choice of Collections/containers/data structures to store record/entries/data.

They all have pros and cons, there is no single right answer for all questions. Every application of a container requires a little thought as to which to use given the intended use.
 
It's not an arrogant assumption, it's just fact. Programmers don't try to make their code inefficient, but they also have to work within budgets and time frames. You simply don't have the time to go back and make things work better unless it is causing a major performance issue.

Are you a hobbyist programmer? It's easy to be a perfectionist when you're not on a budget.

Who said you have to go back to make optimizations?
No one is saying you have to spend days doing benchmarks and profiling. Doing so is almost always a waste of time.
I don't get why some of you guys are going on about optimization and frantically blabbing that speed never matters.
No one has said anything about optimization or that speed is often not at all important. All this junk about Java vs C++ is completely off topic garbage that doesn't relate to anything that people advocating limited maths skills are important to programming are saying.


That doesn't stop you designing a software architecture that is less likely to have a performance issue and has improved scalability and maintainability as a result. It requires minimal thought at design and coding time to make wise decisions. And good programming typically abstracts higher level operations from underlying details allowing low level details to seamless change to meet performance requirements. E.g., most containers/collections provide a similar/identical interface allowing them to be swapped out if need be.
 
Last edited:
In fairness, I'm pretty sure what you're describing would not have been a "simple" website to many people, and may not really be a representative example? I don't disagree with you generally about maths being useful though.

The website is incredibly simple because I made it and I know nothing about web design:D

As I said, It is just Google maps API and I want to display arrows pointing at certain landmarks. Google Maps API doesn't support arrows that are rotated and no other code was found online so I just had to draw my own arrows and rotate them This required very simple GCSE maths to under stand a 2D rotation.

My point is stuff like that turns up all the time.
 
one aspect the OP should consider is what area he/she wants to go into. Some areas pay a lot more than others. If you work for a investment bank, you should expect about 70k ~100k but you will need financial maths
 
Back
Top Bottom