Slashdot Mirror


Math, Programming, and Language Learning

An anonymous reader writes: There's often debate amongst modern programmers about how much math a professional developer should know, and to what extent programming is math. Learning to program is often viewed as being on a spectrum between learning math and learning spoken/written languages. But in a new article, Jeremy Kun argues that the spectrum should be formulated another way: Human language -> Mathematics -> Programming. "Having studied all three subjects, I'd argue that mathematics falls between language and programming on the hierarchy of rigor. ... [T]he hierarchy of abstraction is the exact reverse, with programming being the most concrete and language being the most abstract. Perhaps this is why people consider mathematics a bridge between human language and programming. Because it allows you to express more formal ideas in a more concrete language, without making you worry about such specific hardware details like whether your integers are capped at 32 bits or 64. Indeed, if you think that the core of programming is expressing abstract ideas in a concrete language, then this makes a lot of sense. This is precisely why learning mathematics is 'better' at helping you learn the kind of abstract thinking you want for programming than language. Because mathematics is closer to programming on the hierarchy. It helps even more that mathematics and programming readily share topics."

32 of 241 comments (clear)

  1. Your Results Will Vary by machineghost · · Score: 4, Insightful

    The problem with all the articles like this is that they're either written by people who did take math or didn't, and in either case both believe their side is right. The article is clearly written by someone who took a lot of math so, surprise, he thinks math is good for programmers. But I took nothing past Calculus (and have never professionally used even Trigonometry), and I'm a successful programmer, so I think math is unecessary.

    Until someone actually does a study on this, it's all gonna come down to "the way I did it was better" ... and that's just noise.

    1. Re:Your Results Will Vary by fredprado · · Score: 5, Interesting

      It highly depends on what you do. If you work mostly with the common database applications, basic math is enough for you and it is unlikely that you will ever need anything above Calculus or even Calculus.

      On the other hand, if you work with RF you will most likely need a lot of math. If you work with high level optimization algorithms you will need Abstract Algebra. If you work with Geolocation you will need a fair amount of high level Geometry, specially Non Euclidean ones.

      So in the end the answer is: Higher Math is not necessary in all fields of programming but it is certainly very necessary in many.

    2. Re:Your Results Will Vary by Greyfox · · Score: 2

      I took nothing past Calculus either and up until two or three years ago never even used trigonometry in my professional programming. The last few years I've been writing satellite simulations, which has forced me to knock the rust off some of my old math skills. Most programmers can get away with very little math a lot of the time. A lot of very interesting programming involves a fair bit of math. That programming is generally being done by some guy with a Ph.D. in another field, and he's usually doing it in Fortran.

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    3. Re:Your Results Will Vary by GiganticLyingMouth · · Score: 3, Informative

      I think part of the problem is that "programming" is itself so diverse. If you were to be a graphics programmer, you would certainly need your linear algebra, geometry, etc. If you worked with scientific computing, you'd need even more math (e.g. differential equations, statistics, etc). If you worked as a DSP programmer, you'd need to know calculus (and then some). In contrast, web development doesn't really require any of these. However, they all involve "programming", and the people writing the software can all be called "programmers", even if one's writing a website (no math) and another is doing a fluid dynamics simulation (lots of math).

    4. Re:Your Results Will Vary by techno-vampire · · Score: 3, Interesting

      Studying computer science requires a fair amount of math to understand why some algorithms are more efficient than others rather than just accepting that they are. And, it can be a great help in working out the storage and IO requirements of a program. How much math you need to be a working programmer depends, as you point out, on what branch of programming you specialize in. Personally, I've always considered programming to be more a branch of logic than one of math.

      --
      Good, inexpensive web hosting
    5. Re:Your Results Will Vary by s.petry · · Score: 2

      The reason math helps a whole lot in programming is that it teaches essential critical thinking skills. Some people are good at critical thinking skills without taking math. The _majority_ ,however, require some type of education to help mold their methods of thinking. Many, even with a whole lot of training do poorly with critical thinking skills.

      Claiming that you have never used math in programming simply demonstrates that you are not programming for scientific purposes (writing a GUI for a CAD program is not the same as writing the underlying math structures). That's fine, and most surely is not intended as an insult. As with above, you are not everyone, and math has many benefits.

      I say this as a person who has a degree in Math, and took everything possible in College for math (hated statistical math, but diff-eq was great). I don't sit and run differential equations all day, but do very well helping Engineers and Scientists that _do_ run heavy mathematical models. Hell, when I was in college the only way to learn computers was by being in a math program.

      yeah yeah, get off my lawn!

      --

      -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

    6. Re: Your Results Will Vary by acroyear · · Score: 5, Interesting

      In the end, I've always concluded the same, every year this topic comes up (it is just about annual here). I don't want you to know calculus because you'll actually use calculus on the job (though I have an O(N) vs O(log(N)) question on my interviews that you'd better be able to answer).

      I want you to know/pass calculus because by the time you've worked that hard at that level of proofs, you've mastered *variable control*. In each level of math, you don't get out of the class having mastered it. You get out of the class having mastered the year that came before it. When you can pass calculus, you have *mastered* functions and analytic geometry (I hire for UI work). Passing those two the year before showed you mastered variable manipulation and proofs in Algebra 2 before it.

      So no, you don't *need* calculus on the job, but you need everything below it, and the best proof that you've *mastered* them (not just taken them, but mastered them) is that you've passed a calculus class.

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
    7. Re:Your Results Will Vary by Nethemas+the+Great · · Score: 3, Insightful

      I find that most people trying to argue against math generally are doing so by asserting that if a certain math is not put to practice in the software that a person is developing that that math is unnecessary. It also seems to be commonly asserted that persons with a strong mathematical background are just being pretentious.

      I believe that the anti-math crowd is missing the point. For a software developer it isn't the skill of solving calculus problems, but the skills required to solve calculus problems. What I mean by this is that in order to work to a solution for a given mathematical problem you are exercising many other skills. Skills such as logic, abstraction, visualization, etc. are very much employed in software development. You go to the gym not because you have aspirations of mastering a bench press, but because you aspire for a stronger, healthier body. Mathematics are an example of exercise equipment for a software developer.

      --
      Two of my imaginary friends reproduced once ... with negative results.
    8. Re: Your Results Will Vary by Coryoth · · Score: 2

      Calculus is perhaps not the best measure however. Depending on where you go in the programming field calculus is likely less useful than some decent depth of knowledge in graph theory, abstract algebra, category theory, or combinatorics and optimization. I imagine a number of people would chime in with statistics, but to do statistics right you need calculus (which is an example of one of the directions where calculus can be useful for programming).

      Of course the reality is that you don't need any of those subjects. Those subjects can, however, be very useful to you as a programmer. So yes you can certainly be a programmer, and even a very successful and productive one without any knowledge of calculus, or graph theory say. On the other hand, there may well be times when graph theory, or calculus, or statistics could prove very useful. what it comes down to is whether you are inclined to think that way -- and if so it can be a benefit; if not it won't be the way you think about the problem anyway.

    9. Re: Your Results Will Vary by the+phantom · · Score: 2

      It isn't even about creating well-rounded people, and never really was---the point of a college education was to become an academic. You went to college because your end-goal was research. Of course, at that point in history the alternative was likely monastic life because your older brother was going to get the farm... That being said, it wasn't really until the middle of the 20th century that college was seen as a way of advancing a career outside of academia. Whether or not you believe that the role of universities *should* be vocational training, the curriculum and organization of institutions of higher education---particularly research universities---is still geared toward that Enlightenment ideal of academia.

    10. Re:Your Results Will Vary by Dutch+Gun · · Score: 2

      I took nothing past Calculus either and up until two or three years ago never even used trigonometry in my professional programming. The last few years I've been writing satellite simulations, which has forced me to knock the rust off some of my old math skills. Most programmers can get away with very little math a lot of the time. A lot of very interesting programming involves a fair bit of math. That programming is generally being done by some guy with a Ph.D. in another field, and he's usually doing it in Fortran.

      You're touching on what I consider to be the ultimate fallacy of this question. If someone asks the question "how much math does a programmer need to know?", I'd answer with "a programmer of what?"

      My profession happens to be videogame programming. In my own experience, higher-level calculus is largely unused, but geometry, linear algebra, and matrix math are the bedrock of 2D and 3D simulations. Even then, the level of competence required depends largely on your specialty. A graphics programmer requires more mathematical savvy than an AI or general gameplay programmer, for example.

      Programming, unless you're a theoretical computer scientist, is typically about solving practical, real world problems rather than problems specific to the domain of computer science. The problem domain the programmer is trying to solve is what determines the mathematical requirements, not the programming itself. In fact, you can go a bit farther than this and simply call mathematics part of the general "domain knowledge" which may or may not be required for a particular programming task. It's no different than when knowledge of accounting and bookkeeping is required when programming financial software, or a knowledge of music theory when writing music composition software.

      So, the question only becomes meaningful when you attach it to a specific programming job or industry.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    11. Re: Your Results Will Vary by TechyImmigrant · · Score: 2

      My diet is what made me well rounded.

      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    12. Re:Your Results Will Vary by K.+S.+Kyosuke · · Score: 2

      Actually, that's more of an application of math than math itself. People so often confuse the two! Being able to integrate and being able to postulate very general hypotheses relevant to your problem and to prove them are two entirely different things, however.

      --
      Ezekiel 23:20
  2. Forget math, programming is like organic chemsitry by alphazulu0 · · Score: 2

    As long as we're making gross generalizations...

    A big part of organic chemistry in college is "synthesis" problems where you are presented with a molecule and you're supposed to outline the steps (chemical reactions) required to turn it into a different molecule. I find that this closely mirrors programming where we're manipulating data instead of chemicals. We all have access to the same tools and there's more than one pathway that will work, but we're trying to find the most elegant / efficient solution to get from A to B.

    Most of the students in my OChem class were premeds and many of them struggled with the synthesis problems. A lot of the premed curriculum involves memorizing and regurgitating huge amounts of information, with less emphasis on problem-solving. I always thought the ones that were good at the synthesis problems should switch gears and become programmers.

    az0

  3. Nah ... It's Programming ... by CaptainDork · · Score: 2

    ... and that's it.

    If you're programming litigation, you'll have to pick up some legal knowledge. If it's banking, then finance. If it's science, you'll have to be exposed.

    But ... you don't have to be an expert at anything but programming. The experts do all that stuff. They can spec, but they can't code.

    --
    It little behooves the best of us to comment on the rest of us.
  4. first up let's get one thing straight. by ewanm89 · · Score: 3, Insightful

    Programming is mathematics, it is the application of decision and discrete mathematics. Not all mathematics is infinitesimal calculus (there are different kinds of calculus), algebra or geometry.

    1. Re:first up let's get one thing straight. by steelfood · · Score: 2

      Math is big. It encompasses everything from continuous (calculus) to discrete (logic). It abstracts even from there into levels only mathematicians would understand.

      People who don't know math think it's just calculus or just algebra or just linear algebra or just abstract algebra or some other high level mathematical discipline. They forget that working with integers is math. Set theory is math. Graph theory is math. Boolean logic is math.

      Math is more than all those things combined. it is, at its core, the perfect application of rules unto objects. The rules can be arbitrary. Rules themselves can become objects by moving to a different level of abstraction. But it doesn't matter. It's all still math. As long as there's a rule and an object, it's math.

      Anyone who has any relationship to a computer that doesn't understand this is not suitable for working with (but not necessarily on) computers. That is to say, it's like asking a car salesman to devise the final layout of the parts of a new car model. You might just end up with the brakes in the glove compartment.

      --
      "If a nation expects to be ignorant and free in a state of civilization, it expects what never was and never will be."
  5. Re:I disagree by jbolden · · Score: 4, Interesting

    As a guy with two masters in math who knows 15 languages... I also disagree. There are some languages that are mathematical (like Haskell) but most programming has more in common with cooking (sequencing the application of resources) than math.

  6. Re:Never had to use any college math on the job by Crashmarik · · Score: 2

    I suppose set theory, and propositional calculus/boolean algebra don't count as math either ?

  7. Obligatory Quote by Gauss by thrich81 · · Score: 2

    TFA tries to make the case (poorly) that Math involves ambiguities and Programming does not.
    The greatest of all mathematicians, Carl Friedrich Gauss, stated, "I mean the word proof not in the sense of the lawyers, who set two half proofs equal to a whole one, but in the sense of a mathematician, where half proof = 0, and it is demanded for proof that every doubt becomes impossible."
    Not much room for ambiguity in that.

  8. Re:I disagree by Nethemas+the+Great · · Score: 4, Insightful

    Proficiency in mathematics for the most part has little to do with being able to learn a programming language. This much I agree with. However, proficiency in mathematics does provide a strong indicator as to what you will be capable of doing with those languages. You may not be performing Calculus or manipulating matrices in the software that you write but the skills that provide an aptitude for performing such math are very much relatable to software development. Such skills include, abstraction, visualization, and logic to name a few.

    --
    Two of my imaginary friends reproduced once ... with negative results.
  9. Why Math matters by tommeke100 · · Score: 2

    No you don't need math to write an iPhone App or an interactive website.
    You do need math to understand why looking up some keys in a HashMap is much faster than iterating over a vector.
    You do need math to understand why some encryption algorithms are better than others
    It just gives you the tools to better comprehend what's going on under the hood, so you have more information to make the right choices in how to implement something.

  10. The more math the better by EmperorOfCanada · · Score: 3, Interesting

    I went for years keeping my math and my programming separate. Often programming involves little more math than x++. But then I really buckled down and learned a pile of math which I now pile into my programming. Interestingly enough when I try to show my algorithms to other programmers they say, "I forgot all that math 1 day after exams." But these algorithms often are cutting thousands of lines of code away and result in answers that are instant instead of a more iterative approach that could take minutes or much longer.

    The math that I am referring to is all pretty basic year 1 or 2 stuff. Basic Discrete, basic calculus, etc.

  11. I majored in applied math by Snotnose · · Score: 2

    some 20 years ago (yikes, did the math and it's closer to 30). I wanted to do signal processing and such, but I realized MIT grad students were doing all the fun stuff. I now write embedded software, and the only time I use math is when I either go off on a tangent, or sine off on an apology for doing so.

  12. I programmed Asteroids in Assembly when I was 12 by MindPrison · · Score: 2

    ...on my Commodore 64, since we didn't have any games when it came out.

    Interestingly enough, I sucked at "school math" and flunked math entirely. Imagine the expression on my math teacher when he saw me coding in assembly at the new computer-park back in the 80s, when he barely could understand basic.

    Since, I've made numerous demos in the DemoScene with Amiga, and later on coding robotics AI with MCUs (as a hobby, nonetheless).

    So no, you can absolutely learn to code quite decent software and hardware without deep math skills, but it helps if you want to do real advanced stuff like coding your own Render-Engine (but then again, how many are they?) My advice - learn whatever you need to achieve what you want.

    --
    What this world is coming to - is for you and me to decide.
  13. depends. VBA is very different from systems arch by raymorris · · Score: 5, Interesting

    A "programmer" can be someone who spends two days putting together a complex Excel macro (poorly), or someone who designs an information systems architecture for a significant enterprise. These are VERY different activities.

    On top of that, I'll say that approximately 85% of people doing programming aren't really competent. Compare how often software crashes vs how often cars fail in such a way that they crash themselves. So you have to specify, are you talking about MOST programming, or competent programming? Most programming isn't done competently.

    Well-designed and larger software projects require a thorough understanding of a large set of rules, both knowing what the rules are, and understanding WHY the rules are as they are, and when to apply which rules in order to move forward. In that sense, it's very much like math. Also like math, one wrong decision can lead you down a path of futility, from whence reversing course is time-consuming.

  14. YMMV by xdor · · Score: 2

    Until you hit something that does require higher math.

    Find the optimal coverage schedule for employees next week given their varied availability

    As simple as this sounds, unless you're willing to wait for the computer to churn thru every possibility: you are going to need some higher math know how to program that answer.

  15. Re:I disagree by Coryoth · · Score: 3, Insightful

    Math IS sequencing. So is using recipes. That is how math works.

    Math is a language. Just because you can frame things in that language doesn't mean that that language is necessary. Recipes are often in English. English is sequencing (words are a serial stream after all). That doesn't mean English is necessary for programming (there seem to many competent non-english speaking programmers as far as I can tell).

    Disclaimer: I am a professional research mathematician; I do understand math just fine.

  16. Re:Some loser needs to learn the pecking order by Jeeeb · · Score: 3, Insightful

    In the real world the picking order is more like:

    1. Rich parents / Male who is excellent at a popular sport
    2. Prestigious law degree
    3. Prestigious MBA
    4. Good salesman and good at golf
    5. Economics/Law majors/MBAs who got into strategic/management connsulting
    6. (The rest)

  17. Re:depends. VBA is very different from systems arc by TapeCutter · · Score: 3, Interesting

    TFA is really about the human mind. We understand patterns as different forms of language, music is the most basic and universal, it lights up all areas of the brain, then you have spoken language built on top of musical patterns, then along comes symbolism in the form of writing and icons, math is our most recent and most precise form of natural language.

    The take home message is, expose your kids to maths without boring them to death.

    --
    And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
  18. Re:I disagree by Alioth · · Score: 2

    You might not be terrible at math. I thought I was terrible at math (I'm also a software developer). I also thought I was only good at discrete mathematics (which was a course I took during my university degree, heavily related to programming and CS). Furthermore I thought I was terrible at learning human languages, after having had 7 years of compulsory French at school and not being able to form a coherent sentence in French.

    It turned out I was wrong on two counts:

    A while back I started learning Spanish. The way I was being taught now was in a fun and easy way. I was also self motivated. In six months after starting, I could actually use some of it and knew more Spanish than I did French from 7 years of French lessons. 14 months after starting I was giving a technical talk in Spain (with an admittedly terrible accent and many grammar errors). Later today I'm off to Spain to help organise RetroEuskal with a bunch of Spanish friends. I started learning Spanish in my mid-30s, not as a kid. I learned it far faster than I would have as a child.

    More recently I realised I needed better mathematics skills to be able to do more complex things in my electronics hobby, so I took an algebra course on Coursera. At school I had pretty much flat out failed algebra. In fact I was put into the lower maths set with all the thick kids (where you could only score a C at most in the GCSE, the exam we take at age 16) because both myself and my teachers were convinced that I was bad at the subject. But doing algebra in a course that was interactive, fun and gave instant results - I passed that with a distinction. I then did a pre-calculus course, and passed that with a distinction. I then did Jim Fowler's (Ohio State University) calculus 1 course on Coursera and passed that with a distinction too.

    So it turns out that I was wrong about myself. In reality I was not bad at maths nor human languages. Now I admit I will probably never be a mathematician or linguist, but I can now do two things I never thought I ever would be able to. The reason I never succeeded at these things at school was because they were taught in a very boring and overly complex manner, and I was also pathologically lazy and didn't pay enough attention. The reason I succeeded now is due to having more motivation to do it and being exposed to teaching methods that inspire, and that aren't just hours of boredom.

    Furthermore, while I don't usually use calculus or algebra in my day job, I have found that learning these things has improved the way I approach a problem.

  19. I, in turn, disagree by Half-pint+HAL · · Score: 2

    The big thing holding back computing is that computer programmers tend to think only in terms of algorithmics, and not in terms of (mathematical) computation. Computation in mathematics allows all sorts of funky stuff, and the only area where it is commonly applied is in vector manipulation. Applying matrices to matrices to matrices allows us to create infinite combinations of reusable transforms, which can then be applied to all the vertices in a 3D model at a low cost. Applying a series of algorithmic procedures to manipulate the same data would be unworkably slow. Algothmic programming results in lots of unintended interactions, and hard-to-track phantom bugs in the code. Computation is harder to start with, but it scales so much better and results in much more stable projects.

    --
    Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'