Hacker News new | past | comments | ask | show | jobs | submit login
How much math you need for programming (2014) (lispmachine.wordpress.com)
212 points by mayureshkathe on Dec 26, 2020 | hide | past | favorite | 178 comments



As usual, the answer to the eternal question of “how much formal math training do you need for X” turns out to be “right around the amount the author of the argument has had.” Why is it that we always have to prove the instrumental value of maths education? You’re a lot more likely to “need” your maths in the “real world” than your Shakespeare, but few have much energy for fighting the idea that literature should be studied for it’s own sake. Wondering about the minimum amount of effort required for success is more valuable for its insights into whether this is something you should pursue than for any answer you could find.

So here’s what I should think is the obvious answer: No, significant formal or informal maths training is neither necessary nor sufficient for a successful or even exemplary career as a programmer. But talent and success in the two do seem to correlate pretty strongly, and those who do have above average backgrounds in maths seem to feel it’s beneficial and provides an advantage. No, you don’t need maths any more than you need strong writing skills or comfort teaching or experience with office politics or a sophisticated sense of humour. Those are all, however, astonishingly useful in getting the things you want, even if that’s only a richer experience of life.


I agree with everything you’ve said, but I want to push back on the (non-load-bearing) “few have much energy for fighting the idea that literature should be studied for it’s own sake.”

It seems to me that lots of people have endless energy for this fight, unfortunately.


It’s possible that the sample set of anecdotes I base this on is a bit skewed, as I teach undergraduate maths. In my limited experience I had to put a lot more effort into keeping basic differential calculus in the required freshman curriculum than my colleagues from the English department had to keep the %#^* five-paragraph essay. (Full disclosure, I’ve also taught our “Communications” course because of a misspent youth in an Arts program and work as a technical writer, and my colleagues from the English department supported me in killing the Essay Writing part of the course—-the fight was with government and industry reps who’d swallowed the “soft-skills” pill.)


I am also an undergraduate math professor. In our faculty governing body, I had an argument with colleagues in English who, while urging the importance of the written-communication core requirement, since everyone needs to be able to communicate clearly (a claim with which I agree!), also urged removing the quantitative-reasoning core requirement, since that skill is not important to people in the humanities.

I can see being defensive about the importance of one's discipline in a society that sometimes seems to deemphasise it, but you'd think that struggle would make one more, not less, sympathetic to the need to keep basic literacy in other disciplines.


Exactly. Or, for that matter, might make one think that those basic literacies might enhance each other. I clearly remember participating in an Honours Philosophy seminar where we did close studies of works by Russell and Leibniz, and I was literally the only person in the room who had any formal training in Set Theory or Calculus, and one of perhaps three (including the professor) with Symbolic Logic beyond the freshman intro. The idea that such exposure would be valuable in studying “The Philosophy of Logical Atomism” or “The Monadology” wasn’t one we were equipped to contemplate, much less address. I also recall that my jokes about imaginary numbers during lectures on Descartes fell pretty flat, but that was probably for the best.


You know honestly, we as an entire whole of the world should just go back to hands on training. Forget studying the same crap for 15-20 years of our lives to have a damn calculator to solve basic adding and subtracting that's done on a cash register in our daily lives. How many of you solve out of this world equations in your daily life? 95% of the world doesn't. We all use basic add and subtract. Hardly anyone knows how to start a fire, or kill game to survive. If the internet goes out and you can't check that daily habit of yours, your life is turned upside down. Its a waste to study all these years to find out you don't need to figure out a right side of triangle to drop a tree. If you can count to 10 on your fingers, what's the point of an in depth educational system.


Is this sarcasm?


I think the “problem” here is that there are so many useful things you can do with math that we spend all of our time in school learning the useful things first, with much less emphasis on the enjoyment aspect.

It’s a shame, too. As an undergraduate I had a very small amount of exposure to some papers in theoretical computer science. I presume they were fairly typical for the world of mathematics - trying to establish boundaries on how small something can be. And not much application in the real world. But I remember having my mind blown at the way the authors could take one problem, convert it to some completely different ___domain, and use previous work in that ___domain to prove things about the original problem. It was very beautiful, and I think even that very limited exposure has changed the way I see the world.

Then the real world came knocking and I haven’t been back since.


I would have been happy with useful.

Most of college was proving everything.

Okay, I get this is important for high level math.

I want to do “something” with it.

I did a lot of basic robotics programming for pay in early college. Taught myself a lot of math to get the job done. Later I hit Trigonometry. Wow that would have been handy in that role.


> few have much energy for fighting the idea that literature should be studied for it’s own sake

I agree with your post, except that statement is a bit of personal choice. From my perspective, knowing how airplanes work and how they fly makes my life richer, but I doubt lit majors would feel the same way.

(For example, when my house was built, I noticed a weak spot in the structure holding the house up, and had it reinforced. Without engineering training, I never would have noticed. Does this matter? In my previous house, some of the doors wouldn't close properly, and in the crawl space I noticed the main loads were not supported directly by a column on a concrete pad. The structure there had been gradually sinking. Jacking up that section of the house, installing a pad and a column, fixed that and the doors all worked again. I missed another structural fault until one day a window just shattered from the stress of the distorting wall.)


> Now what does does a mathematician do? He tries to understand nature and uses mathematics as a language to do that.

I would argue that this is wrong. That's what physicists do, not mathematicians. Mathematics is about abstract ideas, which can live regardless of nature or application. Physics instead is about understanding nature. Most physicists use mathematics to do that, but that's just for practical reasons. They don't always take it for granted, there's a very famous article by Eugene Wigner on this: “The Unreasonable Effectiveness of Mathematics in the Natural Sciences”.

I think it's important to understand this. Sure, computer programming is not math. Physics is not math either. Mathematics is kind of a way of thinking, and mathematical language turns out to be very useful in describing and understanding nature and many other things. Computer programming theory stems out of mathematics, but I agree that everyday programming practice does not strictly require an in-depth math knowledge.

But it depends. One day you wake up and you want to solve a problem: sometimes you need programming, sometimes you need math, sometimes both, or maybe you need some business experience, psychology, whatever. We need different perspectives, I don't think we can compartmentalize these things any more.


> I would argue that this is wrong. That's what physicists do, not mathematicians.

Notice that many mathematicians would not agree with you, here (but probably, a majority would). As the mathematician V.I.Arnold famously said, "mathematics is a branch of physics where experiments are cheap". So, yes, in the minds of lots of mathematicians, what they do is precisely to study and understand nature.


I am a mathematician. Nature is of no consideration whatsoever in some fields of maths. But nature or applications to it are the primary focus in many other fields of maths. In still others, nature would be a source of analogies, or applications of a few special cases, etc. Muddying the waters, some mathematicians would expand the definition of "nature" to include completely abstract ideas - anything that feels "discovered", for example.

Mathematics is the study of patterns. Any kind of pattern you can imagine, in anything, including relationships between things. What things? Any things. That covers a lot!


Whatever people may think what mathematicians think, this comment describes the real situation best as I've experienced it.

Most pure mathematicians I've met/worked with actually look down (in a jocular way) on applied mathematics/physics. When Lagrange reformulated Newtonian physics, he was very proud of the fact that he didn't use any diagrams and arrows showing forces in his paper. In fact, of all the Physics I've seen, I found Lagrange's work to be the most beautiful and elegant.

I love how the commenter put it as "Nature is of no consideration whatsoever in some fields of maths". I'd restate it as "Nature is of no consideration whatsoever in pure mathematics" and I'm quite sure that the pure mathematicians would agree.


I agree this is a common sentiment among mathematicians, but this is a very modern perspective. If you look back 100 years ago to Hilbert, there was less distinction between physicists and mathematicians, much less the pure/applied rift that now exists. Arnol'd (who is referenced above) was one of the mathematicians who tried to keep this unity alive.



>I am a mathematician. Nature is of no consideration whatsoever in some fields of maths.

It's not about actual nature (the universe etc) being into consideration.

It's about many mathematicians coming to see maths as exploration (physics-style) of a mathematical universe, so to speak, rather than a simple constructive process.

So, they come to see mathematics as a kind of physics in this regard, no in the sense that they concern themselves with the outside nature. But in that math work appears to them as exploring a natural landscape (just one made of patterns and numbers).


The controversy between assuming a point of view of "creating" vs "discovering" things is as old as mathematics.

> rather than a simple constructive process.

This requires some more distinction. 'constructive' can mean very different things. Some non-intuitionists would consider their counterparts definition of 'constructive' as possibly OK, but simple - and held other cases still for construction. Anecdotally, Ramanujan received his results as an inspiration from his household deity. Thinking about it probably brings up 5 different opinions among two people.


Yes, that's what my comment says (but maybe you read it before I edited it to be clearer):

>> Muddying the waters, some mathematicians would expand the definition of "nature" to include completely abstract ideas - anything that feels "discovered", for example.


Yes, that.

Though I wouldn't necessarily consider it "muddying the waters", but taking another criterium as important in the distinction of physics-like or not.

Namely, not whether it concerns the study of the material universe, but whether it involves experimentation/discovery of in place structures, and other such physics-like processes (which they think it does).


This is muddying the waters though, though I think you’re in good company.

I’m not sure if mathematics belongs in the sciences or art; it really has hallmarks of both.

It a modeling language that can be used to describe the universe. You don’t have science today, without the math.

Yet some of the proofs and mental exercises in pure math are almost divine; inspired in a way that resonates like a beautiful work of music.


>This is muddying the waters though

In a way, yes, as it extends the casual/conventional understanding of the term. I'm just saying it's not done to intentionally muddy the waters, but to introduce an alternative understanding.

So, yeah, we agree!


You could say that math is the part of laws of physics which humans can't imagine being different. You can pretty easily imagine a world where newtons laws are different, but I'd argue it is impossible to imagine a world where 1 + 1 is not 2. However being impossible for us to imagine doesn't mean that such worlds can't exist, it would just have completely ridiculous consequences we can't imagine, so those rules are a part of our universe and not a fundamental logical truth.


> I'd argue it is impossible to imagine a world where 1 + 1 is not 2.

Actually, you've probably done that yourself, in a programming setting: integers modulo 2, where 1+1 = 0. It's useful in places and the consequences aren't too ridiculous in this case.

Following through figuring out the consequences of rule changes is a key thing mathematicians do. E.g. do we need this rule? What if this was weaker? What if this was reversed? What if we had this extra restriction?


That is a number system where 1 + 1 isn't 2, not a universe. At least I can't imagine a universe where the concept of 1 + 1 equals 2 doesn't exist.


Numbers don't exist in any real sense, so we're clearly not talking about the actual physical universe. The universes we're talking about are the spaces of possibilities that arise from sets of rules. Examples include number systems and physics models built on them. Newtonian physics, built on Euclidean space; Einsteinian physics, built on space distorted by mass; quantum circuits, where modular arithmetic can show up.


> Numbers don't exist in any real sense

I'd argue they do, numbers arise when counting and counting is definitely a part of our reality. It is pretty hard to imagine a universe where you can't count things.


We can count things, because we use the concept of numbers. Numbers aren't a physical thing, they are all imagined. How I see it is that physics models can be described using number systems, but the numbers aren't part of what's being described. E.g. the numbers describing properties of particles are categorically different from the particles themselves, and only the particles can interact with other physical objects. An electron can never bang into a 7.


That's because (imo) numbers aren't intrinsic to the physical universe. They are (imo) an abstraction we humans invented to describe certain phenomena. You may not agree but hopefully you can at least see why some people would have this PoV, and especially the more general PoV that mathematics is not about (physical) nature, but about abstract ideas.


I agree. Counting might not have any intrinsic relationship to the physics of the universe, but it's a strange universe where thinking beings can exist, yet are incapable of constructing the mathematical rules that would allow them to count.


For a while, people thought that a universe in which Euclid’s postulates would be wrong would be very strange indeed. In my opinion it is short-sighted to go from “it’s weird (to us, right now)” to “it’s impossible”.

On the contrary, it’s very interesting to explore the consequences of something we take for granted being actually wrong or unnecessary.


In a universe where Euclid's postulates are wrong, like ours, you can still construct them. You're positing a universe where it's impossible to construct counting – i.e., set theory is impossible to imagine, Peano arithmetic is impossible to imagine, Church numerals are impossible to imagine…

In such a universe, how is conscious thought even possible?


> You're positing a universe where it's impossible to construct counting

Not quite. Your parent post was about thinking beings being incapable of counting, unless I misinterpreted, not about the universe making it impossible for anyone to count. My analogy is that for a while our universe was one in which non-Euclidean geometry was unfathomable for at least one thinking species, although it clearly can be observed in the universe.

Counting is something that is deeply embedded in our evolutionary tree (some fish and frogs have a primitive ability to count). So of course it seems fundamental to us. But to me this is not a proof that you cannot think without being able to count in our familiar way.

For example, you could perhaps build a logical system using uncountable quantities and still get something out of it. Like some fish which are able to see which school is bigger and base decisions on this without being able to count.


That isn't a situation where 1+1 isn't 2. It's a situation where 1+1=2 but also 2=0.


To me this is a non-example though because in this context 2 = 0. So 1 + 1 = 2 = 0.


A universe where 1 + 1 != 2 is a universe filled with self-contradictions and so cannot exist.

It's like imagining a universe where True == False. It's not a hypothetical, it's a logical impossibility.


1 + 1 = 2 is based on conservation of particles. You put a marble in a bowl, then another marble in the bowl, you now have two marbles in the bowl. If you remove conservation then there is no reason why 1 + 1 should equal 2. 1 + 1 being equal to anything could just be nonsense in that universe, such a construct wouldn't exist and there would be no way to reason about quantities. That isn't a logical inconsistency, so such a universe could exist.


In modulo arithmetic, 1+1 != 2 can work just fine. We're not talking about the literal universe, but the space of possibilities that opens up when you change the rules. E.g. all the amazing power and complexity that comes from imagining the existence of a number i with the property that i^2 = -1. This was initially thought to be a logical impossibility.

True == False does seem pretty broken though. Not sure that can go anywhere.


I see mathematics as completely opposite to studying nature.

Mathematicians work on extremely simple objects as a basis. For example (since we're here), give them a 0 and 1, and they will spend 200 years building a whole theoretical world from that, an artificial system they will describe through thousands and thousands of pages of theorems, getting more and more complex as time goes.

Nature is an extremely complex system from the start. Trying to understand and describe it is not at all the same approach. You take a complex system (the complexity of the system is given, fixed externally by the nature) and try to simplify it.

You can see this difference in the software world too.

Mathematicians (CS) will build and favour the use languages which are based on a single simplistic axiom: "everything is a list" for the most famous example, "everything is a function" for others, and then you are supposed to build all the rest on those simplistic bases, and in practice that will mean twisting, bending, squeezing the problem world (i.e. the nature) to make it fit in your model.

On the other side, you have programmers, which will more often favour practical, pragmatical languages, which do not exhibit the clean regular, symmetrical simplicity of the former ones, but which are more adapted to describe a complex, irregular world.


In that sense, though, programming would be a branch of physics that's concerned with making brute-force experiments cheap (thus saving the mathematical work needed to find clever tricks to do that same experiment by manipulating a small bunch of symbols).


Well - that's engineering.

Physics is experimental model building of phenomena which are not yet understood and are being explored.

Engineering is experimental model building of phenomena which are mostly understood, albeit sometimes with some quirks and unexpected edge cases.

Applied math is the toolset used in both physics and engineering.

Pure math is the abstract and philosophical exploration of symbolic relationships within all of math.

Academic CS - Wirth and Dijkstra-style - is the tiny subset of pure math used to explore theories of computing.

Practical CS is mostly just relatively trivial puzzle solving using a combination of cookbook academic CS with a bit of invention and innovation with influences from user psychology, marketing, and business design.

The most academic and mathematical parts of practical CS is ML and AI, which are genuinely exploratory. The second most academic part is probably processor architecture, where you may be applying statistical modelling to cache design and instruction pipeline outcomes.

Most of the rest is pretty basic compared to engineering modelling - never mind academic physics.


Speaking of Dijkstra, he famously refused the title "physicist" and instead chose to use the title "programmer".


There’s a difference between applied physics and theoretic physics as well.

Every discipline has its ivory tower and “plebeian” branches.

No need to give physics a free pass :)


Even if a lot of mathematicians think math is about studying nature they are demonstrably wrong. One can do maths that has no known relation to physical reality, has no basis in physical reality or sits in direct opposition to how physical reality actually works. That is precisely the opposite of physics to say that "well, if I can imagine it it must be nature". So by counterexample, since the field of maths contains things that are anathema to the science of physics maths cannot be a branch of physics.

Math is the study of abstract patterns and those cannot be escaped. But just because individual mathematicians dedicate their lives to finding abstract patterns inspired by physics doesn't mean that either physics or math are branches of the other.


You are making a lot of ontological and epistemological assumptions that are contentious in the philosophy of math. Not saying you are wrong in thinking this, metaphysical questions don't necessarily have answers, but many would not agree with you.


> As the mathematician V.I.Arnold famously said, "mathematics is a branch of physics where experiments are cheap".

I think that is not so much subsuming mathematics under physics as a cheeky way of avowing mathematical Platonism, where eternal mathematical truths reside in some Platonic realm of ideas and wait to be discovered (not invented or proven) by mathematicians.


You can read the whole text that starts with that quote here:

https://www.uni-muenster.de/Physik.TP/~munsteg/arnold.html

As you say, it is written in a playful and cheeky manner, but it is just a rhetorical device; the meaning is certainly very deep. Even deeper and longer, but in a similar spirit, you have this text:

http://math.ucr.edu/home/baez/Polymath.pdf

It starts with a famous quote, replicating Caesar's gallic war:

All mathematics is divided into three parts: cryptography (paid for by CIA, KGB and the like), hydrodynamics (supported by manufacturers of atomic submarines) and celestial mechanics (financed by military and other institutions dealing with missiles, such as NASA).


Math, like philosophy, is only interested in using concepts, structures, or otherwise rigorous ideas to pry into other ideas. Like philosophy it is in some senses self referential, and not really interested in discovering some idea of "truth", but rather exploring the avenues by which truth itself is defined.


Then, Arnold also says that mechanics is geometry in phase space (which subsumes physics in mathematics, like in the later “mathematical universe hypothesis” metaphysicians).


you know, as they say, "(...) consistency is the hobgoblin of little minds (...)"


It’s middlebrow but I still love Whitman where he goes “Do I contradict myself? Very well, I contradict myself. I am large, I contain multitudes”.


>I would argue that this is wrong. That's what physicists do, not mathematicians. Mathematics is about abstract ideas, which can live regardless of nature or application.

Regardless of nature of application, yes, but not so abstract otherwise.

Many mathematicians consider math to be more like physics, where you discover things, there is experiments, etc., than a mere axiomatic system where you invent things.

That was an increasingly popular idea about math in the 20th century (and haven't heard otherwise in the 21st).


Sometimes I feel like software developers don't actually know the fundamentals of how the programs run, not taking into account all the math behind the algorithms, etc. Being good developer IMO is first understanding the system from ground up, second - understanding the ___domain and if it requires math, yes, you need to know that as well. Otherwise you can go on your whole career copy/pasting and using APIs/language features you have no idea how it's working.


That kinda describes my experience. I was never formally trained in computer science; I fell into it in my late twenties and taught myself. I never took math at the collegiate level, so I don't really understand the fundamentals. However, I am able to get by for about 95% of the things I've needed to do. But the last 5% is always the most interesting, and I hate it when I hit those walls.


well I hope there will always be that 5% left that you can't answer yet, and that you find interesting enough to learn more about. At the end of the day, that's probably the best way to learn more maths and get a deeper understanding of how computer programs work, at least that was the case for me who's, so far, been pretty bad at learning theory without having applied it first.


Most developers don't work in domains where there is any math as per se.

I do however feel a little sorry for the some /r/programmerhumor post-ers, who are obviously students who think that everyone just copies stackoverflow - I understand what my code does, I look at the assembly etc. etc. I wrote my first interpreter at 14/15 though so I may not be the best example, but you get the idea.


> I would argue that this is wrong. That's what physicists do, not mathematicians. Mathematics is about abstract ideas, which can live regardless of nature or application. Physics instead is about understanding nature.

I would disagree. They both are the study of nature just different aspects of it. Mathematics is the study of the some of the more universal formal causes, while Physics also involves the particular material causes.


Yep. A better version would be:

> They try to understand mathematics and use mathematics as a language to do that.


The question seems a bit backwards to me (who come to programming from maths). I am more familiar with the opposite question "how much, if any, programming do you need for math?" Every year I meet lots of math students who love math but hate the very idea of programming, as if it was a dirty and unnoble thing to do. I have to convince them that sometimes it may be useful for them. The best course of action is to start by offering the game: "you don't need any programming for math, except in very particular cases". This gives them a clear starting point where they feel safe. Then we work from there, showing them inductive experiments that would be impossible without computing. For example, it is well known that Gauss would check, by hand computation, many theorems about prime numbers before attempting to prove them. This entailed many days of tedious hand computation that he was very proficient at. Today, most of these experiments can be programmed in a handful lines of code and the computer verifies them in a second. Then some students are eager to actually see these lines of code, but more importantly, to see their result.


Having come from the science I think you have a good viewpoint. We didn't learn programming to program. We learned it because it is a useful tool to model and stimulate. A necessity to do science in the modem world. It was only later that I started to dig in more because I found that I actually liked using this tool.


As someone who has formal degrees in Math, I believe this is mostly because the programming Math students do is extremely tedious and simply not enjoyable. In school we were making graphs in Matlab/Octave/Mathematica/R which I think most programmers would not like. Maybe some used Python if they were lucky. Coding visualizations, solving matrices or convex optimizations in Mathematica is not exactly inspiring.


When working with CSS/design I used subtraction, multiplication and division. When working with e-commerce/finance I used algebra. When making a 2d game I used geometry. When making a 3d engine I needed to learn about vector, matrices, etc. When working with weather forecasting there where formulas involving sin,cos,atan etc. So while you do not need math to get started in programming/development, you will definitely stumble on it. And you don't really know your math until you put the wrong formula into programs/production used by thousands of people.


When you do design you need to know about typography, when you do finance, you need to know about accounting, when you are making a game, you need to know about game design, when you are doing weather forecasting, you need to know about meteorology.

None of them are skills that a programmer needs unless he works in the field. Maths is the same. You need very little maths to code unless your field requires it.

And even then, sometimes you don't even need to. I worked on a software that computed material fatigue with absolutely no idea about the maths involved, the mechanical engineers just told me the formulas and constants to use as well as the expected results and I implemented them. (not entirely true, but it was just personal curiosity, absolutely not required for the job).


It definitely depends on the work you are doing. When working in aerospace I used maths a lot, 3D vector work as well as physics like velocity, acceleration, gravity simulations etc were all pretty important. I have also had roles where I suspect I never used much beyond basic addition and multiplication. But if your maths isn't there you are not going to be getting roles that are heavy on the fundamental maths problems.

It is the same with algorithms. Some times a role is utilising the basics all the time and you rarely get passed some DB access, lists and maps. In others I have needed to build a Type 2 ary tree with lockless parallel access. I think what ends up happening is that most projects have some tough stuff and some have a lot more of it but you can contribute to those projects without knowing how to solve it because the bulk of most programming is fairly simple. But that deeper knowledge is needed by at least someone on the team at some point in time.


Reminds me of a buddy of mine working on a computer game. Gravity needed to be simulated -- easy enough, the formula is as basic as it gets. Results looked wrong to him though and he ended up using some trigonometric function instead ;-}


Most games don't use 9.8 for g. There's also the bit about how Mario violates Newton's First Law when he changes direction mid-air, but don't let physics get in the way of fun.


Bunny hopping (https://youtu.be/SNvDUO42Hys?t=47) is reliant on the player being able to play with their momentum without touching the ground


I gave up maths as soon as I could at school (16) and didn't study it for an A-Level. It was required for my CS degree, but they let me in without it. I had to apply myself a little more to pass the maths modules, but I don't think maths has really been important to me or my career.

I can totally understand WHY maths would be important for some programmers (and why thinking mathematically would help), but "programming" covers such a spectrum - for me it's always felt more like the Lego I spent my entire childhood building was more important. Somewhere between logic and creativity.


Same here, although my degree didn't require maths A-level.

There are times when I wonder "hmm would I have known this alreay had I done A-level maths at school?" but that I think is general imposter syndrome more than anything. At least for me, I've never needed anything particularly special maths-wise for professional work, apart from derivatives for ML/AI and even that was just academic-self-pleasuring from the course I took... no ML library requires you to mathematically prove something before you can use them (at least not the ones I have used)


I did A Level Maths and I don’t recall any of it showing up when I did my degree at the University of Liverpool.


I'm a game programmer, so I definitely have some bias (bare minimum of acceptable is somewhere between advanced high school and first/second year linear algebra, with some calculus being very helpful), but in practice I've found the more math I know, the more I use. I've been working on stats recently in the evenings, and have used quite a few of the concepts in my day job already.


I didn't get a CS degree precisely because I bombed out of math so bad in high school that I couldn't get admission to any program. Here in Canada a good grade in academic-stream high school math was simply mandatory for admission to any BSc program. Took a philosophy BA instead, though didn't finish it... dropped out to go get a job programming during the .com boom, and now 25 years later I work at Google.

Was a long road, and would have been a lot less torturous if I had been better in math. Not because I've needed math much in my programming career, but because my bad math became a reason that gatekeepers closed doors on me over and over again. Perhaps the strongest cause of imposter syndrome I have at work is less related to not having a CS degree -- because I feel like I know about 99% of the content of any CS program -- but more to do with the fact that I work around a lot of maths geniuses.

In reality the "math" I failed in high school was more arithmetic than mathematics per se. I feel like I might have a disability around numbers but I've rarely had problems with the higher level symbolic manipulation involved in algebra or programming or symbolic logic, etc. though my probably-ADHD means I have to really step back and work through things at my own pace in my own environment, and so whiteboard coding type interviews really piss me off.


> Here in Canada a good grade in academic-stream high school math was simply mandatory for admission to any BSc program

Perhaps that's why I've always found excellent engineers from Canada's flagship schools (U of British Columbia and U of Toronto) :p

More seriously though, I have an advanced degree in Math and seldom needed it for development work, even when I was working in more quantitative roles. And whenever I did need the knowledge I would just look up and learn again. Glad you're doing well without a traditional background.


If I were to pick flagship schools for Canada for computer science and engineering, it wouldn't be those two... it'd be U Waterloo and U Alberta. Well, ok, U of Toronto, yes, but UBC doesn't come to mind.

But in Canada generally we don't have the same level of status game around school reputations that Americans seem to have. Certainly grads from U Waterloo do very well, but they may have as much to do with their excellent intern program than anything else.


Interesting. Alberta is really only known for reinforcement learning as one of the leading academics relocated to Edmonton, but they're not known for much else. You won't hear of Alberta much in academia or in Silicon Valley, and the only reason I know of them is due to prior interactions with Richard Sutton.

UBC and UT certainly receive more funding for computer science and engineering and they're generally well regarded research schools and highly recruited from. UT seems to be slightly more prominent but I'd wager it's a result of the school being much larger with multiple campuses all considered the same school. Same story with Waterloo's computer science faculty being many times the size of UBC with mandatory internships in its undergrad program.

Perhaps the reputation of schools domestically in Canada is different than their brand overseas, as UBC is known even in Switzerland and Sweden, but Alberta and Waterloo are completely unheard of. Even now as I relocated to the USA, UBC comes up often (despite the relatively small Computer Science faculty) and all the past companies I used to work for across quantitative finance and autonomous vehicles recruited from them.


There is a reason why Google's (by far) largest engineering office in Canada is located in Waterloo region.


You need all the math for the ___domain. If you are in engineering, games, DSP, ML, then that can be a lot. At the same time some developers can go a whole career without ever (knowingly) using a floating point number. They work with web sites/services/databases/apis etc.

But developers should at least know basic calculus, logic, and what what you need to grok basic algorithms and data structures. That part of math isn’t even meaningfully separated from “programming”. It’s one and the same. Programming is math. Math isn’t just a useful skill that some times pops up as useful. Without math, programming is merely typing.

How much English do I need for writing?


Meh, disagree. A bunch of developers I know don't know the Pythagorean theorem but they are crazy good (developers). It completely depends on what your job requires you to do. For some developers to be great, they don't need even middle school math.


I agree with this 100%. Hard math rarely has a use outside of it's scope. How often are you really trying to simplify the cotangent multiplied by an arcsin? Sure people who deal with trigonometry do often. But that subset of people is even smaller than people who do geometry. I'd wager carpenters do more math on a daily basis than the average programmer.


Not knowing some part of mathematics doesn't preclude them from doing something mathematical.

The fact that middle school mathematics is often disconnected from what most people would find useful is a big problem.


I doubt Pythagoras would show up very often outside of ___domain problems, but basic logic and polynomials, logarithms etc shows up everywhere where you do algorithms and data structures.

Math is a language and a developer will get a code review explaining something using that language (complexity etc).

You can do without it but that doesn’t mean it’s a good idea not to simply know those things. It’s not years and years of math, it’s a tiny bit.


Programming is nothing more than a list of instructions. Understanding data structures doesn’t require math, just logic. Maybe some mathematical operations can be derived from observation but the numbers behind it don’t really need to be known.

I’ve never been able to grasp mathematics as numbers. My ability to work with numbers is severely compromised by my disability. This hasn’t hurt my ability to excel as a web developer. In fact, while I can’t visualize individual formulas or algorithms, I can visualize very complicated applications. And I likely know what types of algorithms and data structures would be likely be optimal.

Even if I don’t know the “correct” math, I know where to look for it.


> Programming is nothing more than a list of instructions.

That’s not true for every language paradigm.


I still fail to see how calculus relates to programming for what most people do. Web or not.


Simple example: monitoring your systems when data only increases, like number of hits to your site or queries to the db. That graph is always up and to the right. However, if you look at the rate of change (cough, derivative/calculus), the graph now tells you interesting things. Granted, the calculus understanding there is superficial, but it is there!


We can talk about those things without the language of calculus, though: "this graph shows requests per second, and that graph shows cumulative requests." And I think it should be clear how to derive one graph from the other, with or without calculus training.

IMX numerical integration is useful in some areas (like physics simulations), but I haven't encountered any non-trivial applications of the kind of calculus that's taught in most schools, which focuses on continuous functions over the reals.


It crops up when you start to do statistics usually. That said programming itself is usually more about discrete things, so knowing about calculus is more helpful in figuring out what to use programming for than programming in general.


Calculus doesn't relate to the work of the programming majority. I've only seen it used for ___domain-specific work or in contrived examples (like LeetCode-esque problems).


I mean things like knowing simple polynomials, which ties into things like asymptotic complexity. Which has the word “asymptotic” in it. That basic.


With that weak of a definition of math, you might as well say any first year high school subject is a prerequisite. If you didn’t pass any of those, chances are you’re not a great programmer either.


How much English do I need for writing?

That would depend on what sort of writer you were and what sort of ideas you are trying to share (and, I guess, your audience). Most famously, Hemingway's The Old Man and the Sea is written in a such a way that an 12 year old could read it and understand the plot.


But you use math all the time when programming, probably without thinking of it as math. Boolean logic is math. Incrementing an integer is math. A pixel coordinate is math.

But most programmers don't need to use or understand the specialized notation of math - all the weird and beautiful symbols. We use the programming language as notation instead.

Some branches like calculus or statistics are not used regularly by the average programmer, but other branches like integer arithmetic or boolean logic is pervasive in any form of programming.


There is a joke/saying/anecdote I heard a long time ago that may or may not be relevant

"Programmers are mathematicians that solve all their problems by Induction"

After being a software engineer for over half a decade now, that still rings strangely true to me


I'm not sure I agree with that outside of functional programming.


For loops, while loops, and recursion are all induction. Functional programming is just a style of programming, as in, algorithms which are designed and proven using induction can be implemented in imperative or functional styles.


I don’t understand this. Could you elaborate on it?


From Wikipedia [1]

"Mathematical induction proves that we can climb as high as we like on a ladder, by proving that we can climb onto the bottom rung (the basis) and that from each rung we can climb up to the next one (the step)."

For-loops are a discrete form of mathematical induction and is a basic concept to do any kind of programming, hence the joke (of course its more nuanced than that but is true in a tongue-in-cheek kind of way)

[1] https://en.wikipedia.org/wiki/Mathematical_induction


"Induction" means you prove it's true for 1, then you prove that if it's true for 'N', then it's true for N+1.


I think the only possible answer to how much math do you need is that it depends on what you work on. There is a lot of stuff that can be done only using very basic math, that's for sure.

I would tend to agree with the article that math can be quite useful as a general mental model and can often help to find cleaner solutions to some problems.

There are also a lot of applications that require some, often quite specific, knowledge of math: machine learning, cryptography, game engines, to name a few.


For sure. The question itself is wrong because "programming" is not a monolithic field. You'll need more math for some areas than for others.


Off topic personal story time:

My high school offered a programming class for the first time (1998). I took it my freshman year, not having the required math. I remember realizing my sub-par math book was out on my desk in front of the teacher, then quickly hiding it. I think he pretended he didn't notice.

Of the 35 students (total) that took the class, 8 completed it. There was no second year class but the teacher (one of the few whose name I remember) asked me to come back next year and be his assistant and receive training one on one.

The next year, the school canceled the class. I checked out of schooling from there on.


1) How much physics and math do you need to ride a bike?

2) How about designing and manufacturing a bike? Spokes and gears and diameters and metal expansion / contraction coefficients and whatnot.

3) How about doing number 2 from scratch? You start with some iron-enriched bacteria sludge ....

For 1), not a lot. Same for basic applied programming. I was perfectly fine modifying source code files to change strings & output without understanding any math, or even much programming.

For 2) When I wanted to develop a trading application, I needed some. It was before proper APIs, so I had to learn about rounding and what pitfalls it entails for currency. But today so much of development is glue. I made a license scanning and identifying app just by using someone else's code and gluing it together, but you bet there is math underneath doing the text recognition.

And then, if you want to develop something algorithmic, such, as, an example, a search algorithm, well, you are basing your algorithm on theory, and some of it math. Behavior and the concept of quality comes in, etc etc, but you better be good at math.

So really, if you want to make a product, you should be asking how much traction do I need before I invest more in the product.

If you want to program, you want to program what you like. If you need to program to solve a problem, then you start with the science classic, the literature / ___domain review. It sure will outline how math heavy the ___domain is.

And if you want to address something with math, you probably know at least some math. I'm not going into how you address finding out what you don't know.

My point, as many others have made above, is: how much math you need for programming depends on what you need to program, and why.


There are two different problems actually : what you write, and the quantitative aspects of your code.

What you write may or may not have a strong maths component ( game engine vs crud app say, or PDE solver vs typical 'plumbing' app).

However, the moment you start having performance issues (and this is everywhere), maths comes in very handy : big o, back of the envelope calculations, orders of magnitude, etc. You may call it engineering (and to a large extent it is), but I tend to lump quantitative reasoning on the math side and not on the compsci/engineering side. It's not necessarily extremely sophisticated, but having a 'quantitative view' of your code can help a lot.

I remember many many years ago developing a sudden interest in algorithmic complexity (and what quadratic meant..) after having used a bubble sort to sort polygons in my 3d engine. Needless to say, log became a fairly interesting function after reading a bit more on sorting!


I'm self-taught with minimal maths and this is something I've used. I started re-learning some basic math for fun and now I find it helpful now to visualize mathematical models of some basic runtime characteristics of my programs. A simple example is that I will visualize X number of users firing Y number of requests, and I'll actually imagine this as a live system with various statistical properties (% of errors and the like). It's not typically strictly mathematical—I don't write down many (if any) numbers or symbols—but I'm creating a quantitative model in my mind to think through the behavior of my program when actually in use as opposed to a sequence of logical commands like I usually do.


Indeed! I very much agree with the model vs sequence opposition.

Another useful side of the model / math approach is that it allows you to formalize your problem and derive hard bounds, ie know in advance what's achievable and what's not (the 'let' s derive a bound' approach being another standard method in maths).


I have/had a few colleagues with almost no math knowledge beyond primary school. One was quite a good programmer, interested in all kinds of technical stuff. He had failed secondary school because of, well, reasons, but he wasn't dumb, and wrote decent code and was quite inventive. Another one was someone with a business school degree who had changed careers. Not a glitch in his school career, but his math was very weak. Not a great programmer, but he had a good feel for UI. I've also had a colleague with a math PhD. He was a very good programmer, although not very fast.

In my experience, you don't need it if you work on the more conservative projects. If you want to build the next YouTube or facebook, you might find a good understanding of math invaluable.


Followed you fully, right up to the end. Why would a good understanding of math be invaluable to start the next big thing?

At their core, isn’t what makes them great, their simplicity? Upload videos, connect with other people?

I’m no math wiz but can probably code an MVP of the product that FB and YT were when they launched. The colleagues you described probably could too. Would love to learn more about the hidden complexity!


I think (and I believe the parent poster does too) that math becomes relevant when things are starting to scale. Sure, creating an MVP of FB can be done quickly with minimum knowledge of maths. However, if it starts attracting a lot of users, suddenly algorithms and theory becomes very very important to minimize cost while optimizing performance.


It really depends on what software you're working on. If its regular web development, eshop, fintech etc, math knowledge required is close to none. Backend or frontend doesn't matter. If you switch to more advanced software e.g. geo, cad, games then it's a different story.


That's not just true for math, it's a more general fact - if you make software in a particular ___domain, you're going to need ___domain knowledge.


What math you need has changed over time. Today, probability and statistics are used more, while discrete math and number theory are less essential. CS used to have a lot of automata theory, and that's not important much now unless you have to write regular expression parsers.

If you do anything with graphics, you need a subset of matrix math, and there are graphics books which cover what you need. If you get into robotics, you need differential equations.


The Steve Yegg link: http://steve-yegge.blogspot.com/2006/03/math-for-programmers... (The given link didn’t work for me)


Just a random opinion:

You don't need math at all to make a computer program. All you need is a computer with some kind of language that is easy to run installed and a tutorial for hello world for it.

But what about programming a program that does some math calculations? Seem like it would be good to know those math calculations that you need to implement...

Or lets take accounting software for example? You need basic math most of the time but it turns out it is quite valuable to know about accounting. Yes, you can write an accounting software without knowing any accounting and just depend on what product manager tells you. But it is much easier to understand what he is saying if you know a lot about accounting... It is also much easier and faster to make decisions without going to product for each tiny detail.

You can expand this to the problem of building teams. You can read few tutorials on agile development and what not, however knowing psychology and having enough empathy to understand people you work with in depth will bring much better results then any so called management book that is taken literally.

And so it goes... The more you know about how world works the better decisions you can make that eventually might lead you to better solutions to the problem at hand.

This is a general thing in life in my experience, but also one that seems to be looked over quite often... The more you know about problem ___domain the better you will be at problem solving inside that ___domain. Coding that solution into a computer program at that point is just a matter of knowing how to use that tool (which is a specific problem ___domain in of it self.)


I would say 'studying maths teachs you how to abstract problems' or 'computer science usually cares for the results, not the method' but that has been said a lot in other comments (and it's not exactly right).

Instead I will point an interesting fact I've noticed myself among my computer science classmates (from my second degree, I first did mathematics).

When you stumble around 'maths' (which in classes it's pretty common, to explain things using mathematical formulas, but in the real world it's also common to have some explanations even in stack overflow using math expressions), in that situation other computer science students usually see them as something 'strange', something to be afraid of or reject by searching alternatives; whether myself and other math/physics-students just don't care, we are used to it (and most times it's just a function)

My opinion is: you don't need maths (99.99% of the time), but you also don't need to be afraid of them and knowledge is very good for that.


In twenty years of coding I’ve used math beyond junior high algebra exactly once.


I know the question posed here has nuances (the question of the title of the blog post as well as its contents as it tries to answer.

Here’s a simple truth I’ve found about it though:

It’s more than you think, but less than advertised in the end.

A lot of the most complex mathematics is abstracted away from the average or even maybe not so average developer.

This I would say is a loose guideline more than a rule of course, there are exceptions

I will say though that what I have learned is that a typical thing we need to be better at as developers (myself included) is math related to date/time and currency. These are actually quite complex problems that even the best developers get wrong


Depends on what you write.

For some applications, you need a great deal of advanced dynamic maths, for some applications, matrix math, for some, heavy-duty topology, etc.

I have a lot of admiration for folks that write software that implements advanced mathematical reasoning, but that is only a part of what is required to develop shipping applications and systems.

For me, I learned the standard calculus stuff, but never used it. I was never a math whiz.

What has probably had the most impact for me in my work, was good ol’ Algebra 2. It taught me how to do things like express word problems as formulae, use variables, balance equations, understand functions, abstraction and encapsulation, etc.


It would be nice to have a map. Some programming is plumbing.. some is investigating (maintenance).. some is more attention to details (specs and protocols) but sometimes it's raw wide and deep math. You don't solve dynamic programming problems without a mathematical thinking (or else I want to see 'you' operate :)


> You don't solve dynamic programming problems without a mathematical thinking

Absolutely. Reflecting on my path, I got that in Algebra 2. Everything after that, was really just scaling and application.

Calculus is 90% trig and algebra. Lots of it, and applied. Quite voluminous, but rather pedestrian.


It's all depending on the ___domain you work in. When working as a web/app frontend developer I've barely ever needed any real maths knowledge beyond basic algebra. As a backend developer, I've had to read up on certain select algorithms. As a game developer I've had to study a bunch of trig, pathfinding and search algorithms.

It also depends on the stacks you work with of course. If you are doing doing a lot of Haskell for example you probably want to understand category theory and lambda calculus and whatever.


Over the many years, I've taken over 25 university math courses. There are a handful that I feel I would not have missed as a programmer. I've been a computer scientist and software engineer for over 45 years, here are the mathematical subjects I've taken college classes in divided into two groups:

Useful for at least some programming or work I've done in the past:

* Linear Algebra

* Geometry

* Calculus and Vector Calculus

* Differential Equations, Partial Differential Equations, and Control Theory

* Logic

* Combinatorics and Graph Theory

* Number Theory

* Fourier Analysis and Laplace Transforms

* Operations Research

* Discrete Math

* Computability

* Probability

* Statistics

* Numerical Methods

Classes that I haven't needed for programming yet:

* higher levels of Abstract Algebra, Non-Commutative Ring Theory

* Real Analysis, Complex Analysis, Measure Theory

* General Topology (I suppose some concepts are useful in category theory and perhaps kernel transformations in machine learning are superficially similar to the subjects covered in Topology)

The world is full of programs so some don't require much math, but mathematical sophistication is needed for advanced programming and young programmers should do their best in school to learn math well.


0

Unless you're in an area that needs math, e.g. fluid simulation, computer graphics, proving algorithms, deep learning, crypography etc.

Although there is pure mathematics, I'm not sure there is such a thing as "pure programing". It's all applied, to do something. So there's always another field required. Sometimes it's math.

There is theoretical conputer science, but (a) it's not programming and (b) is it math.


I think as a programmer you usually need to understand boolean algebra. And if you are working with some data (tracking some analytics, or measuring performance), some very basic statistics is needed as well. Otherwise I think it just depends on the ___domain you're programming in, I can't think of much else that would be general. Idk if you'd actually call these basics "math"...


> You want to learn computer programming, then learn computer programming. Do not flip through Math books, read whatever is written on a particular newsgroup (comp.lang.c, comp.lang.lisp for example).

I'm sorry but how long has it been since newsgroups were relevant? I loved them back in the day but it's absolutely not where a programmer noob should go in order to learn programming.


Yes, you are right, in 2020 Stackoverflow and other forums have taken over. Usenet is no longer relevant (not 100% true, but you get the point). Web-based forums are the places where one learns now. Also, the documentation of different software, libraries and tools has improved a lot.

I wrote that blog-post back in 2014, that was 6 years ago. I learned programming from 2005-2008 and all of that was because of the help I got from the mentioned newsgroups. There used to be a few known names on USENET and everyone knew them and ask them for help. I really loved USENET. These days comp.lang.c is mostly filled with spam and comp.object died sometime ago. Life is about change.


I have found Reddit r/lisp and Freenode #lisp to have great communities these days. They serve as good alternatives to comp.lang.lisp. It wasn't always so but both communities have evolved over the last decade to become more friendly to beginners.

Also some of us here from this forum also hang out at a Freenode channel named #spxy (also accessible via https://app.element.io/#/room/#spxy:matrix.org on Matrix). This is a small computer science and mathematics literature club, so quite relevant to those who are curious about or who work in the intersection of mathematics and programming. Incidentally, many members of this channel are also Lisp programmers.


The Math proponents here I think should accept that it's a little more '___domain knowledge' as opposed to inherently part of the craft, which is I think the point of the article.

'Musical theory' background probably correlates pretty well with 'good programmer' in my completely unscientific guess, though it's obviously not remotely a requirement.

'Building' however, is quite fundamentally different from 'theory'.

Do you remember the supposedly 'not so bright kids' who went to work in 'shop class' because they liked 'working with stuff' and not 'stuff in books'? I don't they were so dumb.

The process of 'making' engages us on an entirely different level than intellectualizing, and I think really differentiates the discipline. There are many bits of software that we use daily, not made by 'genius' but rather the sweat and effort of 'some guy who did it, mostly because it worked'.

You don't need any maths, but it's probably a good sign if you do.


I would say computer science is useful, but as in any craft, you can get by without a theory.

Confusingly, CS is considered to be a branch of mathematics, but it is still quite different from "traditional" (up to 19th century) math (linear algebra, calculus). I have a slightly different philosophical view, I consider CS to be on equal footing with most of traditional mathematics. In my view:

- Traditional math (which came mostly out of physics and geometry) studies primarily infinite but countable structures (functions on countable sets, infinite series). The finite structures are often considered trivial, and the uncountable structures are considered to be too large to have practical importance.

- Computer science (gosh I wish there was a better name of the two disciplines) is concerned with finite structures which are too large (in practice, functions on sets with more than 2^32 elements) to be represented by enumeration. In analogy to finite/countable/uncountable sets distinction in traditional math, small structures that can be enumerated in practice are trivial in CS, larger structures (infinite ones) are pretty much impractical, and they are simply universe in which we operate. (This leads to algorithmic languages, which are essentially descriptions of arbitrarily large finite sets.)

- There are other branches of mathematics, logic, category theory, algebra, which are concerned with building bridges between the two above subareas, which are probably many.

My point is that for (theory of) programming, you need computer science (focus on large finite sets), and study of infinite sets is less useful. But historically, it's not how mathematics became subdivided, and it is a distinction useful from applications of mathematics, not mathematics as a general study of structures (regardless of size).


>Traditional math (which came mostly out of physics and geometry) studies primarily infinite but countable structures (functions on countable sets, infinite series). The finite structures are often considered trivial, and the uncountable structures are considered to be too large to have practical importance.

I don't think this is the case at all. Basically all of calculus theory in based on uncountable structures and it's arguably the most used branch of mathematics.


I understand what you're saying, but disagree. In calculus, uncountable sets are just the theater, the real actors are sequences. As long as the theater is a complete metric space, we don't really care about its structure. Hence the name, it signifies that we are unconcerned with cardinality above aleph 0. The finite/countable/uncountable distinction IMHO shows where the focus is.

Analogically, in CS, you use infinite sets (integers) but you don't really care what the cardinality is. You don't care about the axiom of choice.


> As long as the theater is a complete metric space, we don't really care about its structure.

I agree with that, but I fail to see how that means that traditional math studies primarily infinite countable structures.


Perhaps better would be to say that traditional math studies structures constructed from countable building blocks (and we don't care so much whether the result is countable or uncountable).

In contrast with CS, where the building blocks are finite, and the resulting structures can be large finite or infinite, which in practice only matters a little.


My CS tutor at university used to say that calling the discipline "computer science" is like calling chemistry "test tube science" :).


You basically need almost no maths knowledge to learn programming. This is the first thing the person that trained me told us. Especially for fields like web development and stuff. Sure, if you need to send rockets to mars, it's not the same.

With 12 years of experience, I would say this is true. I would even say that my fucked up logic makes me a very good debugger.


As a CRUD or frontend dev you should be able to know the numbers from -100 to +100. Modulo is a bonus. Anything else is not required for the majority of programming jobs/tasks.

Yet beginners getting hazed and outsiders getting scared with CS/algodat and math is essential for keeping wages up and „normies“ away.


- there is a lot more to programming than CRUD and frontend

- you're putting algorithms and data structures in the same basket as mathematics - algorithms and data strucutures are useful in pretty much any programming job including CRUD and frontend


Algorithms and data structures are mathematics.


+1, -1, mod 2. My 25-ish year career.


It depends on the scale and latency requirements: for a startup creativity and pace of execution/person is the most important (just like Facebook in the early times).

But when you're working on a huge project with many people and many users, lots of data (while slowing down the number of new features), math gets very important for modelling the behaviour of that huge system and getting every extra $$$ out of the network effect.

I myself love math, and a very bad fit for small companies, while people who just like to get dirty in throwing together features thrive there.

As an example Facebook was dropping messages for a long time, and when Google started Google+, Facebook got serious in fixing bugs with consistency of its features, and started to focus on latency (using Google hires of course).


How much math you need for programming does not have a single right answer. Often you can get away with very little math, but if you know math, you may be able to see patterns in the ___domain you are working in that allows you to come up with a much better and more elegant solution than you would otherwise. Or you can attack problems that the people around you consider too hard or go beyond the standard library used in your ___domain.

Then, if you don't know the math that applies, you may never even see the opportunity, and be convinced that math does not applies to what you do, and that you never needed it in the first place.

And often, it makes you the most natural person to work on the most interesting and challenging problems.


Many yarns ago I completed a CS minor. I had been coding since early high school so aced the programming courses. The last requirement was 200 level Math dept. "Algebra" or 300 level ECE 'Discrete Math.' Ruined my 4.0 in the minor and to this day I still can't fathom why such a class was a requirement (though CS was in the math dept at the time).

As I recall, the emphasis was primarily on graph theory with no applications. Maybe its nice to have for a undergrad CS major but even there I wonder what percentage will go on to actually need/use such material? I suspect it is fairly niche.


The most critical thing a programmer needs is a sense of order-of-magnitude, to know when the thing he/she is building or implementing is going to break. And a sense of how likely such a thing is to break, again, within order of magnitude common sense-driven probability.

From loops to architecture, this is applicable. Of course, you can apply this deeper, to processing efficiency, fetch times, etc. etc.

I think most other fancy equations or theorems can be learned as needed. But sense checking your math with skepticism about your own assumptions, and knowledge of orders of magnitude, is key.


Unless you are doing something novel, not so much imo. I generally trust standard approaches and tools, I'm not trying to write my own encryption, right, or reinvent wheels. You can often get by with no real understanding of the underlying math, just what you put in, what you get out, and what that generally means. Lots of respect to you math geniuses who make it all possible. I'd rather play and prototype stuff than perfect and get into the nitty gritty. But math in programming is great for learning and understanding, it being actually applied.


The question is fundamentally misleading. Amount of math needed depend on task you do. The first atom bomb simulated using programming and a simple html is also written using programming.


If you're programming a basic business app then you won't need too much math. If your app is simulating the big bang origin of the universe you would probably need a bit more.


>> If you're programming a basic business app then you won't need too much math

Unless its in finance.

I'm a front-end developer and never needed any math until I got a job at a large finance company. We had several mobile apps that required some calculus, statistical models and some differential equations.

In college, I only had to take through Trigonometry for my major so when I was suddenly tasked with this stuff, I eventually had to lean pretty hard on two of my co-workers who had CS degrees and were much better with it than me.

I got through it unscathed and ended up with a much greater love and appreciation for math.


Reminds me of one of my favorite jokes, I have forgotten who said it, maybe Dijkstra?

"Computer science could be called the post-Turing decline in the study of formal systems."


There are certain problem domains where university level math is required. In my five decade career in commercial applications, including actuarial and yield computations, you just plugged in the formula the actuary or math graduate gave you. As far as operating systems,database and hardware control were concerned, elementary school arithmetic was more than sufficient.

Recently linear algebra has come to the fore for AI.


Spoiler alert: not so much.

It’s probably better to be well organized and a bit of a cleaning maniac to keep your code clean and easy to maintain.


It depends on what you mean by 'math'. Calculus? Not that much. Formal logic? Programming is applied formal logic.


We're staffing for a new project involving navigation systems and we need to find a few people who are comfortable with partial differential equations, etc. You'd be amazed how many "computer programmers" are out there that have not completed a course in or have no memory of calculus!


For most professional programming jobs, you do need some math. For example, you need to know to subtract one in zero indexed languages, and you need to know how what numbers are bigger than other numbers, so you can pick the StackOverflow answer with the most upvotes.


Not much it seems. Concepts like logarithmic and exponential growth can be found everywhere, maybe one just needs the right approach to grasp them. I can't think of much more that's needed to become a decent programmer.


I think the answer really just depends on the ___domain you are working in. Web dev, not much, Data Science, mostly stats, the physics engine in a custom game engine, well a lot of calc, geometry and such


Having a good math basis keeps you from jumping down rabbit holes.


I work at AWS. The highest level math course I've taken is College Algebra.

I wish I had taken more math courses and now I'm seeking to learn on my own or possibly taking classes.


So basically in programming, mathematics is abstracted...

This can be generalised even further!

In programming X is often abstracted, so you don't need to know much of X to know how to program...


For those programmers who are weak at math and trying to figure out just how much and what kind of math is required to get started with programming or get better at it.


I’ve been trying to do some work with signals among other things and for the first time in my life, I wish I had payed attention to trig and calc.


slightly off topic but do you have some resources that explain maths in simple language, or using visualisation and code samples? Although I had calculus, linear algebra, probability theory, and discrete maths at uni, I have forgotten most of it. This sucks especially because from time to time I bump into a problem that could easily be modelled elegantly using math.


I think the ML and data science folks are close to Math. I agree though generally speaking most programming doesn't involve math.


It depends on what problem you want to solve.

"How much X do yo need for programming"

It helps to have knowledge about X if you want to come up with a solution.


Programming is not math. Computer science however is based on boolean and predicate logic and borrows requires mathematical thinking and methods as well. That being said I don't find the basic algorithmic analysis stuff very math heavy unless we go into induction and analysing recursive functions.

That being said some domains equipment require a fair bit of maths. Currently working on a game engine and trigonometry and linear algebra are very common tools for me.


Hm. To me programming is a subset of mathematics. You are right it is not math, but its origins are definitely mathematical. There was Alan Turing who built the first computer to decifer nazi communications. But the axis too used "programming", by calculating optimization algorithms to determine rocket trajectories... Of course there is more too it, but an understanding of mathematics is good for any programmer.


Yes I agree with you but I like to make the distinction between computer science and "programming". I.e the study of computer programs and algorithms is absolutely based on math but most of every day programming isn't really focused on that. As in when you write your business logic or UI code or whatever there's not that much math per se related to the software itself more just the ___domain math if any.


Yea I'd agree with that too.


Asking the converse. Are there any fields in programming that require like measure theory or topology or whatever?


Normal computer or quantum computer?


If you’re remotely interested in understanding ML, calculus and linear algebra are essential.


A lot more than people make out, at least in my experience. There’s a lot of talk about how you don’t need maths or cs theory but to me this only seems true for certain areas or levels. For me its been especially true with performance, cs theory and maths can help you to know what and where to optimise and give you ideas on the how.


Jonathan Blow has a good talk about this. He says when he interviews he wants somebody that will default to a naive implementation (because most code is not performance-sensitive and you should optimize for development time in those cases), but he expects people to have a wide knowledge of tricks and techniques for the ~10% that is performance sensitive. That seems fair to me, as somebody who probably wouldn't pass his standards and needs to develop my algorithmic knowledge to handle that 10% better.


This sounds interesting, as you mentioned it’s not that often that you need these skills but the times you do it’s incredibly difficult to know where to start without some theory. Also unsure why my original comment was downvoted, I did preface with saying it was my experience not a fact.


How much? Depends. In some contexts essentially nothing. In other contexts up to and including some of the most advanced known so far with advances wanted.

First, Military

During the Cold War, around DC a large fraction of the interest in programming was for some of the math for the work of the Cold War.

Then I was programming at the David Taylor Model Basin in numerical fluid flow, that is, solution of the Navier-Stokes equations. Some of the work involved an early computer algebra package Formac; I used it for local series solutions to the equations.

Later there was work with the fast Fourier transform (FFT): A guy had wired up a hardware box for the algorithm. I showed him a version of the FFT that used the same signal flow graph at each algorithm stage. His jaw hit the floor: That version of the FFT could have saved him a big fraction of all the circuitry in his box.

Later I was in a software house bidding on a software project from a Navy lab. In part the lab wanted to be able to analyze and simulate ocean waves. They wanted to regard the waves as a second order (covariance) stationary stochastic process. For the analysis, calculate the power spectrum of data collected at sea on ocean waves. Then for the simulation, generate sample paths of the stochastic process with that power spectrum. So, I dug into

Blackman and Tukey, The Measurement of Power Spectra,

saw the statistical basics, and quickly wrote some illustrative software that did the work. One of the lessons was, to get an accurate power spectrum takes, roughly, some number of cycles of data at the frequencies of interest so that at low frequencies, i.e., for ocean waves, need possibly a lot of data, hours, where in radio engineering can need just seconds. I showed the results of my software, and our company got sole source on the software development project!

Second, Academic

At one point, I was consulting in programming, data analysis, and algorithms at Georgetown U. and teaching courses in computer science. One prof had programmed some polynomial curve fitting and was getting bad numerical accuracy. There are connections with the notorious Hilbert matrix. I programmed for him a version based on constructing polynomials orthogonal over the given input data; that approach had much better numerical accuracy.

Third, Commercial

E.g., GE was running a computer time sharing service, and there I was the main GE HQ guy for math, numerical analysis and statistics. So, it was statistical hypothesis testing, classic regression analysis, analysis of variance, factor analysis, polynomial curve fitting, some non-linear curve fitting, random number generation, sorting algorithms, all of standard numerical linear algebra, interval arithmetic (for guaranteed numerical accuracy), digital filtering, the fast Fourier transform, solution of ordinary differential equations, and more.

Later I was programming at FedEx. A first little bit of math, hard for the other FedEx people, was how to calculate great circle distances. A simple solution is to use the law of cosines for spherical triangles. The software I wrote to schedule the fleet used that solution.

Later FedEx wanted some revenue projections. We knew (a) our current revenue and (b) the revenue at the planned full service. So, the projections were a version of an interpolation between those two. So, how was the interpolation to go? I argued that the growth would be from word of mouth advertising, that is, viral growth and that growth would be directly proportional to (i) the number of current customers talking about the service and (ii) the number of target customers to be hearing about the service. This led to the first order, linear, ordinary differential equation initial value problem

d/dt y(t) =

y'(t) = k y(t) ( b - y(t) )

where t is time (in days), y(t) is the revenue (dollars) a time t, b is the planned capacity of the service, k is the constant of proportionality, and y(0) the current revenue. There is a simple closed form solution. We picked a value for k that gave a reasonable graph, and that was our projections.

Uh, with more details, each of those two FedEx projects saved the company once.

It may be that currently in the commercial world there is interest in principal components analysis and various cases of curve fitting, linear and non-linear.

Fourth, Startups

Currently I have two startup projects going: In some contrast with

Sam Altman, How to Start a Startup

at

https://startupclass.samaltman.com/

key to both is some relatively advanced, original math I derived. The math is the crucial key to being able to deliver the service and is the secret sauce, "unfair advantage", technological barrier to entry, difficult to equal.

Broadly, the power of current computing is a wide open invitation to use the computing to do the data manipulations for some math that can be powerful for some real problems. Then that computing needs programming so that it can help if the programmer knows the math.

Net, in some contexts it can help if a programmer knows some math.


Agreed!

> Computer Programming is not Math. Let me say it again, computer programming is not Math and will never be. You want to learn computer programming, then learn computer programming.

Programming is far more aligned with writing than math. If you want to be a better programmer be a better writer. Math will not make you a better programmer.

Conversely, programming will not make you a better writer, but it will make you better at math. This is complicated, but provable with testing.

The term math is extremely misunderstood. Math is not a practical exercise, it is a philosophy, a way of thinking. Lay people believe the word math is interchangeable with arithmetic, which it isn't. Arithmetic is the expression of immediate computation. Math is more than that.

Writing algorithms and instructions is algebra. Algorithms are always algebra. Always. Algebra is the conveyance of instructions, which is inclusive of arithmetic, but is more expansive and accounts for variability. The word algorithm literally comes from the Latinized name for the father of Algebra, Algorithmi. https://en.wikipedia.org/wiki/Muhammad_ibn_Musa_al-Khwarizmi

Planning is calculus. Calculus is the expression of continuous change. Calculus accounts for states in fluctuation and differentiation. Calculus allows for thinking in terms of various potentials and collections of decisions.

The reason why writing makes you a stronger programmer but math doesn't is because math doesn't force critical examination like writing does, at least not until you get to Calculus. The reason programming does make you better at math is because it teaches you to solve tough math problems without ever having to do math, because Math is a philosophy, a way of thinking.

This is provable with numbers. Simply test people, compare the testers, and then compare those differences against programming capability. This is provable objectively with numbers. If you want to hire better programmers test for writing performance. The best filter of a group of candidates, for programming potential, is a tough essay to write under time pressure.

When I took the military aptitude test, the ASVAB, the first time I was 17. My scores indicated that I was smarter than 79% of the people who took the test that year, but the only score that really mattered is the GT score. It is an examination of solving complex mathematical word problems under time pressure and is graded on a scale of 0-130. I scored I 107. Smarter than average but not smart enough to become a military officer. 17 years later when I wanted to be a military officer I needed to retake that test at which point I was smarter than 98% of the population who took the test that year and I scored a GT score of 129 (out of 130). I had been programming for 6 years at that point.


Look, this discussion again. What exactly is math is never actually discussed.


and that’s so problematic that Wikipedia has a page on it: https://en.wikipedia.org/wiki/Definitions_of_mathematics.

What’s more, that page says “Mathematics has no generally accepted definition. Different schools of thought, particularly in philosophy, have put forth radically different definitions. All proposed definitions are controversial in their own ways.”

I think all programming can be considered math (not higher math (https://www.merriam-webster.com/dictionary/higher%20mathemat...: “mathematics of more advanced content than ordinary arithmetic and algebra, geometry, trigonometry, and beginning calculus”), but math)


Of course it is. In this case, it's the biggest subthread here.


How much vocabulary do you need for speaking?




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: