6 ms·
For some odd reason, whenever you ask whether math is important to programming, there is a strong correlation between the depth of a programmer's mathematical t
by raganwald 16y ago
For some odd reason, whenever you ask whether math is important to programming, there is a strong correlation between the depth of a programmer's mathematical training and his belief in its importance.
There can be many explanations for this, but the simplest is that when you have a tool in your tool chest, you tend to use it, and when you use a tool, you see opportunities to use it everywhere. Whereas if you don't have a tool, you don't see the opportunities it affords, so you don't know what you're missing.
Even if my conjecture is true, this doesn't mean that mathematics is more important than some other experience a programmer might bring to their career, so I am not suggesting that the author is wrong when suggesting it isn't important. Perhaps it's useful but less important than some other skills.
I'm not a mathematician, so I don't know, it's all blub to me.
- maxawaytoolong 16y agoThe inverse is actually true... the deeper your mathematical training is, the more you realize how unimportant it is in most programming. The people who espouse otherwise either haven't studied enough math, or more usually, haven't done that much programming.
- Niten 16y agoWell my hypothesis is that regardless of one's opinion of the value of mathematics to programming or mathematical knowledge, one is likely to advocate that a strong mathematical background correlates with opining one's given assessment of the value of mathematics to programming ;)
- jemfinch 16y ago> The inverse is actually true.. Evidence? > The people who espouse otherwise either haven't studied enough math, or more usually, haven't done that much programming. Dijkstra? Hoare? Knuth?
- ecuzzillo 16y agoOr they're doing programming in a domain that involves a math a fair amount of the time. (Like robots.)
- RiderOfGiraffes 16y agoIn my experience as someone with a lot of math in my toolkit, many, perhaps most, of the people I work with end up wishing they had similar skills. It's not just me saying math is useful, it's the people who have seen it used.
- raganwald 16y agoSo perhaps: there is a strong correlation between the programmer's exposure to mathematics and his belief in its importance. ?
- scott_s 16y agoI agree with that, but it's hard to believe something is important if you have no concept of it. (People know that "math" exists, but until they've studied specific areas, they probably will have never been exposed to those concepts or ways of thinking.)
- gurraman 16y agoTotally off topic: have you read PopCo by Scarlet Thomas? If not, you must.
- RiderOfGiraffes 16y agoNoted - on my "find to read" list.
- noahlt 16y agoI'm still a full-time student. What math should I learn?
- RiderOfGiraffes 16y agoWhat year? What experience do you have? What math have you done? What are you interested in? Number theory. + What is modulo arithmetic? + If p is prime and 1 <= a < p, why is a^(p-1)-1 a multiple of p? + If a prime is conguent to 3 mod 4, why is it never the sum of two squares? + If a prime is conguent to 1 mod 4, why is it always the sum of two squares? Topology + Find examples of why path-wise connected is stronger than "not disconnected". + Show that in 2D if you consider parallel lines to converge at infinity, and that they all converge to the same point, then what you have is a 2-sphere + Show that in 2D if you consider parallel lines to converge at infinity, and that non-parallel lines converge to different points at infinity, then what you have is a Moebius strip with its edge glued to a disk. (projective plane, or RP2) Analysis + Understand why the sum 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + ... diverges (and what that means) + Understand why the sum 1/2 + 1/4 + 1/8 + 1/16 + ... converges, what that means, and what it converges to. ++ Note: most undergraduate mathematicians get this wrong. There's a bunch of stuff, and this is all straight from the top of my head. It's not necessarily good advice, but they are a few things I found interesting when I was 12 or 13.
- edanm 16y agoJust another possible explanation - cognitive dissonance. You work hard to "gain" a tool, you're going to think it was worth it.
- cynicalkane 16y agoMath--the fun kind, at least--consists entirely of thinking about abstract logical objects. A lot of programming is also this. They usually don't line up, except in cases like Haskell's type system, but the brainpower you develop in one is useful for the other.
- fragmede 16y agoMore specifically, there's so much more to math than the 'boring' number manipulation long division stuff that everyone hated in 4th grade. Any time you combine previously separate if's and use Demorgan's law, that's basic mathematical logic at work.
- ubernostrum 16y agoTrue. But when people write "programmers should know math" articles, what they're almost always actually saying is "I took linear algebra in college, therefore all programmers should have taken linear algebra in college", not "programmers should be able to engage in abstract logical reasoning". My own take on this is that many programmers like to believe their chosen subset of the field (in the case of "learn math" articles, often people who work in game development or scientific computing) is the only "real" programming, and that everyone who chooses another subset is deluded, stupid or otherwise inferior.
- jdp23 16y agoI agree about this correlation in general -- although personally I'm a counterexample: a degree in applied math, and a strong belief that it's not particularly important to programming. True, in programming you need to think rigorously and abstractly, and the same's true in math. However to be a great programmer you also need systems thinking, the engineering skills to use components that don't always work as advertised, understanding of social dynamics [both how software is constructed and how it gets used], etc. etc. Math doesn't give you any of these. So it seems to me that there are other ways to learn rigor and abstraction that are at least as good a preparation for programming as math: different branches of science, law, operations research, user experience, etc. etc.
- silentbicycle 16y agoThere are parts of linguistics that also apply directly to programming, particularly when working with compilers and parsing.
- jdp23 16y agoExcellent point
- Someone 16y agoThere also is a huge difference between the two groups with respect to what they think math actually is. Many lay persons do not know that logic and discrete mathematics are math. The moment you reason about the control flow in your program, or even when you figure out that a for i=1 to 10 loop will terminate, you are doing math. If the problems aren't hard, the math isn't hard, and you can even get away with some trial and error math (aka debugging). However, for harder problems such as a file system's source code, an encryption library, or a multi-threaded program, tweaking the code until it 'seems to be robust' is not the way to go. For those, you need good maths skills.
- indrora 16y agoI'll argue this. my grandfather worked on AT&T System UNIX with what was basically an 8th grade education. if you read "Secrets of Consulting" there's a few rules that my grandfather laid out; one of them is "If you're doing math above elementary level, you're doing it wrong". I've done many very powerful things with that rule.
- ebneter 16y agoYour grandfather is Gerald Weinberg? His books have been a big influence on me and I recommend them to lots of people!
- gruseom 16y agoIndeed. He has had a massive influence on the profession and on me personally. Secrets of Consulting is a great book and something every software person should read. It's not just about consulting. It's much more useful than that, and so entertaining that it's surprising how profound it also is. However, there are a couple of problems with indrora's comment. First, Jerry Weinberg has a Ph.D.; that's a little beyond 8th grade. I also remember hearing him talk about majoring in physics as an undergrad because computer science didn't exist yet. And I've never heard of him working on Unix. He was an IBM guy after all. More importantly, I doubt that Weinberg ever objected to using advanced math to solve technical problems, including programming problems, when appropriate. What he repeatedly (and rightly) has objected to many times is complex models and metrics that purport to quantify human behavior when in reality they're not measuring anything significant. Weinberg regards this as a form of escapism (my word not his), a way of hiding behind technicality to avoid facing human situations. He wrote a whole book, in fact, called First Order Measurement arguing that simple measurements -- including just plain personal observation -- are the best way to monitor complex systems like a software project. Weinberg was the great humanizer of the software industry. You can see his influence hugely on Agile (the good parts, not the slick parts, which I heard him denounce as early as 2004). I think it took enormous courage for him to talk about Virginia Satir in software circles - or would have, if software people had any idea what Satir did.
- purpledove 16y agoPlease see Dennis M. Ritchie's short bio: http://cm.bell-labs.com/cm/cs/who/dmr/bigbio1st.html http://cm.bell-labs.com/cm/cs/who/dmr/bigbio1st.html He has deep mathematical talent. Ken Thompson also has deep analytical abilities as demonstrated by his contributions to computer chess: https://chessprogramming.wikispaces.com/Ken+Thompson https://chessprogramming.wikispaces.com/Ken+Thompson Guido van Rossum holds a master's degree in Math and CS. I'd say that it is common sense that mathematical talent is correlated with coding talent provided that the person receive substantial training in coding. Generally speaking, everyone is a terrible coder for the first 2 years, it doesn't matter if you are a math genius, you still need to learn how to crank out good code. The real question is: is there extra correlation between math talent and programming talent beyond both being correlated with g, the general intelligence factor. See: http://en.wikipedia.org/wiki/General_intelligence_factor http://en.wikipedia.org/wiki/General_intelligence_factor
- joe_the_user 16y agoYes, math is one tool in a tool chest. Tool ... good. Tool with two thousand years of history behind it, very good! However, I haven't notice a similar degree of correlation between programming and Egyptian history... Knuth was about literate programming, so maybe English literature could be good tool too.
- vital101 16y agoThe importance of math in programming is directly related to the domain you are working in. The strong logic background math gives you is important for anyone who programs, but advanced concepts just don't matter that much to most programmers.
- RiderOfGiraffes 16y ago<fx: sighs and starts rant and posibly excessive claims unsupported by objective evidence> It's not the math, it's not the advanced concepts. It's the ability to think in abstract terms, about abstract objects, rigorously sometimes, intuitively sometimes. It's not the direct benefits. Knowing topology or analysis is unlikely ever to help you. Being able to do topology and analysis probably will, in subtle, unexpected and most often unnoticed ways. Every single advanced athelete does progressive weight training. Why? Certainly not because they want to be able to lift weights. No, it's because of the side-effects. Similarly doing advanced math trains your mind in ways that are relevant to programming, and unobtainable elsewhere. I won't convince people who are already convinced that math is useless, and most people who haven't done any advanced math will see that they don't appear to use it, and thereby believe that it's useless. It's all blub. Obviously.
- nadam 16y agoI agree with you generally, but how much mathematical thinking will help you still depends extremely on the kind of job you are doing. In my experience the single thing in which mathematical thinking can help you best is going meta. When you reason about the program as the program were data. It is not a coincidence that smart people with mathematical talent wants to go meta: they love to write frameworks, new programing languages, compilers, (graphical, database) engines. But most of the programmers have to write good old application logic (so called business logic) using languages, frameworks, engines, technologies made by other people. I go further: most people have to use bad programming languages, programming languages which are not their choice. Most people have to maintain bad quality code created by other people. For these tasks mathematical thinking is really secondary. You have to have other skills: very good memory, finding your way in a complex mess, etc... If you are mathematically 'smart', you will find patterns, you will be bored, you will go meta, and they need to find another guy for the mundane task.