17 ms·
Programming is hard
- RiderOfGiraffes 16y agoOK, here's a really biased point of view. The author says: It's OK to suck at math; you won't be using much anyway. I'm not sure how this stereotype got instilled in me, but I'm slightly embarrassed to admit that I was surprised to discover how little math is involved in day-to-day programming, ... That depends. The amazing thing is how knowing math can help in so many unexpected, tangential, apparently unconnected ways. Time and time again the guys I work with do stuff that would be easier if they knew more math. When I pair with them they frequently say that they wish tehy knew more math. It's OK not to have a PhD, it's OK not to have a degree, but at least knowing about, and having a good, intuitive grasp of what goes on in topology, linear algebra, analysis, graph theory, game theory, logic and more is immeasureably useful. Unless you're doing the kind of coding that really doesn't require design or algorithms or data structures or communications or database work. I've never used stuff I did in my PhD, but time and time again, continuously (and I use the work correctly, I don't mean continually) I've used the stuff I learned on the way that enabled me to do my PhD. Learn more math. It will be useful, even if only to give you the option of rigorous reasoning.
- MaysonL 16y agoI did enough math at college that complex data structures and algorithms were not at all scary. Recursion just reminded me of the infinite descending spiral of the ideals in Noetherian rings :) And working through the proofs of the equivalence of a dozen different versions of the axiom of choice helped me learn to reason about my programs. Never used more than a trivial amount of the math content, but the math processes of thought have been invaluable.
- CodeMage 16y agoRecursion has always been my favorite example of how learning math helps understand programming. If you've ever proven something by induction, you should have no problem understanding recursion.
- deleted 16y ago[deleted]
- edanm 16y agoHonestly, I think most people who "prove" things using induction don't really understand what they're doing. Then again, most people don't really understand recursion either.
- tkahn6 16y agoHonestly, I think most people who "prove" things using induction don't really understand what they're doing Can you explain what you mean by this?
- edanm 16y agoSure. In my experience, most people who go through math classes at a University, not to mention classes in High School, are mostly "blindly" following a template of how to do induction. They don't really understand the principle behind it, why it's a valid proof technique, etc. Put another way, if I used induction incorrectly, I could probably still trick them into thinking it's a valid proof because it looks like induction. The same goes for a lot of things in Mathematics. The same also goes for recursion - most people don't really understand recursion (unless it's used at a "simple" level, like in Tree Recursion).
- lmkg 16y ago> if I used induction incorrectly, I could probably still trick them into thinking it's a valid proof because it looks like induction. You mean like this one? http://en.wikipedia.org/wiki/All_horses_are_the_same_color http://en.wikipedia.org/wiki/All_horses_are_the_same_color My college calculus professor used this example when she was teaching induction.
- jemfinch 16y agoThat's a perfect demonstration of the difference between epistemic induction (unprovable) and mathematical induction (provable).
- Xurinos 16y agoI agree with you. I find many reasons to know math during my career and in my programming hobbies. It is hard for me to ever take the statement seriously. We are not even talking about calculus here... I surprised a fellow developer in the Dark Mists MUD by converting a table into a simple linear formula ("What should Y be when X is at this point in the range?"); this is grade school geometry, right? I just needed the formula for a line! In my regular work, it is surprising how many times people do not understand the need for variance or standard deviation when they are looking for quality in averages of their data sets. So web programming? If you have to put up charts of large data sets, things will get hairy without at least knowing how to interpolate the data points. A slow website may be a result of brute-force simplistic approaches in the code. Some of the packages we use (such as jQuery) require some good math knowledge to implement (example: drag-and-drop). We certainly cannot generalize that in web programming, it is acceptable to not know math. You can get away with not using math in our industry if you leave it to others to do it for you.
- cullenking 16y agoSpot on. You may not need math if you are working on very very standard boring things, or on some system level stuff. However, the moment you need to work with real data and do cool things with it, you are often left SOL without the ability to figure out the math. Many people grab a scientific toolkit (psipy and the like), but understanding what a Gaussian filter is vs calling a function for it, does an immeasurable amount of good anytime you need to decide what your particular dataset needs.
- feral 16y agoThis is framed as a letter sent back through time to an earlier self. I don't know what kind of programming the author does, but I was sending such a letter to myself, I would absolutely not say 'Its ok to suck at math'. I'd be much more likely to tell myself: "Don't worry so much about learning about hardware specifics - spend lots of time on abstract math, it'll come in handy all sorts of places later".
- CodeMage 16y agoHe offers a clue: "[...] I was surprised to discover how little math is involved in day-to-day programming, especially for a web developer."
- RiderOfGiraffes 16y agoExactly, but if he doesn't know much math, and he does suck at math, and it doesn't think he uses it much in his day-to-day programming, he will think it's pretty useless. And he'd be wrong. As commented in another reply: ... Never used more than a trivial amount of the math content, but the math processes of thought have been invaluable. In spades. How many people are crap at something, realise they can get along without it, and thereby conclude that it's useless? Most. It's like being incompetent and unaware of it. It's an unknown unknown.
- torme 16y agoI was pretty good at math in school, but I dont like math. Therefore I haven't focused on it. I think your assumption is that people think like: I like programming. I'm bad at math. Math doesn't help my programming anyways. Instead I think people think like: I like programming I'm bad at math, so I don't like it. I'm going to look at other fields to improve my programming. I think the problem is, and the author hints at it, is that people tend to over glorify the importance of math at the expense of drowning out other fields, like prose. In some fields like web programming, I would say that yes, my time is better spent learning how to write understandable code instead of how to solve complex equations. As a result, I probably won't ever program video games, but thats ok, games take a lot of math, and I wouldn't enjoy that anyways. It's not that I'm lazy and just don't want to get better at programming. I just want to get better at programming in ways that I enjoy the most. With infinite time, I would certainly do it both.
- nadam 16y agoI have been a programmer since I was a child, and I was also good at math, I won competitions, etc... But interestingly I was only interested in and good at discrete math. I loved mathematical logic, set theory, number theory, graph theory, algorithms, solving tricky logical problems. But I was not good at calculus. I did not understand why complex function theory is relevant and why I have to leran so much calculus. I now of course know some calculus, and already I don't hate it. But I still think that some part of math is not very cruical to a programmer, and some parts can help the programmer's abstract thinking. So I would change the kind of math which is taught for an average programmer. The other thing is taste. If you are quite good at math you will like those jobs where math is involved. Unfortunatelly this can hurt if you have only have some mundane programming job. I certainly cannot use my theoretical knowledge at my job, I can only use it in side projects. I know a mathematician with orders of magnitudes bigger math knowledge than me: his taste is so abstract that even tasks which I find exciting are boring to him. His taste is so abstract that he is excited about only theoretical math reasearch. He is a researcher mathematician and he don't create any programs at all and his research is not really related to practical things. I know programmers who have smaller math knowledge than me but are more passionate about their day job than me and perhaps they are even more productive for this reason at their day job (which is the same as mine.) Passion is more important than knowledge. So if you want to be a good and happy web developer I think there IS something like too much math knowledge.
- chipsy 16y agoInteresting. I'm also very discrete-biased in my math background, perhaps because it lines up neatly with problems in digital computing. I never did well with calculus, but interestingly enough, my interest is more awakened now that I'm doing coding for a software synthesizer, which has to approximate continuous functions all the time(as sample buffers), and deal with the various distortions from said approximation that are taken care of "for free" in an analog environment.
- jdp23 16y ago> I've never used stuff I did in my PhD, but time and time again, continuously (and I use the work correctly, I don't mean continually) I've used the stuff I learned on the way that enabled me to do my PhD. One of the best software engineers I know has a law degree and says exactly the same thing. So I suspect that the same is likely to be true for anybody else who's gotten a PhD or other advanced degree.
- johnaspden 16y agoBut law, maths, computer science, and weirdly, classics all appeal to the same minds. Are there examples of people with English Literature or History degrees who say the same? I would have thought they would be more useful for the sorts of things that programmers are bad at, like dealing with, or in, lies and half-truths. And not be so good for the 'long chains of precise reasoning' type problems. Of course, you might equally say that being able to handle the political side of life 'makes you a better programmer', but I don't think you'd mean it in the same way. Ideally you'd want both.
- jdp23 16y agothere's a big difference between "appeal to the same kind of mind" and "you should study this subject to become a better programmer" and yes, I do mean that being able to handle the social side of life (including politics) makes you a better programmer in the same way. agreed that you want both.
- CodeMage 16y agoWhile I agree with the general idea behind the article, there are lots of specific details I disagree with. For example: It is absolutely crucial to pick a first language with a deep, expressive vocabulary for this reason, and all programming languages are not created equal. Not really. I started with BASIC, on ZX Spectrum 48, and I actually used it to write a real-world program which was used by real users; if you're curious, it was a pop quiz for biology classes. Yes, it's probably the worst code I've ever seen or written. Yes, it had all sorts of problems and bad practices you could readily think of and then some that would require you to be very imaginative. No, it didn't cripple my development as a programmer. The problem is not in which language you pick as your first language. The problems start when you start believing that's all there is. Some of the most important things I've learned were things I encountered when learning a new, more powerful programming language, precisely because they were impossible (or extremely difficult, or too messy) to express using the old language. They challenged my understanding of programming and helped me develop even further as a programmer.
- johnaspden 16y agoStrong disagreement. My first language was also Spectrum BASIC (I'm not dissing it, by the way, a mighty engineering achievement and my life would have been much poorer without it), but it's not a language I'd expose a child to today, because you need to deal with all sorts of accidental complexity to see some of the deep ideas. On the other hand, the Spectrum environment was almost perfect considering the hardware available. In the same way, if you want to learn OO, learn Java rather than C++, where the same concepts seem very much more complex. And that's probably true even if you want to program in C++ eventually! Probably better to use python than either, because that's got the least accidental complexity of anything and can express a wide range of ideas, as far as I can tell. My favourite language at the moment is clojure, but actually some of its nice features like pervasive immutability would make things hard for a beginner. Better to learn how to do everything and then decide which powers you want to not use. So I guess my ideal beginner's computer today would be a modern ZX Spectrum running a version of python with a lisp syntax (for macros). pg's original vision for arc sounds like a good spec. And of course an essential requirement would be a printed user manual as friendly and straightforward as the ZX BASIC manual or the TRS80 one.
- forensic 16y agoThe math question just depends on the type of programming you do, and on your definition of math. Programming is such a wide field. There are web designers who fit rectangles together all day long, and then there are the people who write Mathematica.
- nzmsv 16y agoLast time this got posted there was some interesting discussion: http://news.ycombinator.com/item?id=1053753 http://news.ycombinator.com/item?id=1053753
- raganwald 16y agoFor 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 agoLast time this got discussed: http://news.ycombinator.com/item?id=1053753 http://news.ycombinator.com/item?id=1053753 someone in this comment: http://news.ycombinator.com/item?id=1054048 http://news.ycombinator.com/item?id=1054048 said: "especially for a web developer" is the important part. As a fellow web developer, I agree. I'd certainly like to get into the mathier side of programming someday, but it's rarely necessary for my day-to-day operations. That misses the point entirely. How do you know it would be useful if you don't have any? And do you only, ever, and always want to be a web programmer? Why limit your options?
- jonhendry 16y ago"Why limit your options?" I suspect that focusing on mathy programming jobs would tend to limit your job options, at least in most regions of the US.
- RiderOfGiraffes 16y agoPeople seem regularly to assume that getting good at math means you therefore need to do mathy programming jobs. That's exactly what almost every comment here is trying to refute. It's not doing math that limits your options. I've never seen a prgramming job that wouldn't benefit from the programmers knowing more math. Every programming job I've seen has benefited from more math. And I've seen a lot of programming jobs, Including ATC, weather forecasting, financial, CRUD, web scraping, automotive and more. Even gathering data from a database and presenting it in a template has occasionally benefited from a bit of obscure math. It's just that people who think math is arithmetic, formulas, equations, calculations and calculus don't realize what they're missing, and just how widely applicable it is.
- mgrouchy 16y agoI have a CS degree, I have done my fair share of math, its a requirement. That being said, I'm not amazing at math(working at becoming better), I'm passable for sure, understand concepts, not amazing on the details. It all comes down to the question "How do you solve a problem you don't know how to solve", a lot of times hints for how to approach these problems are given in certain areas of computer science and mathematics. If you don't have the tools(computer science and math) it can make your life significantly harder for a particular subset of problems which probably align pretty well with the problems you realize you don't know how to solve.
- agentultra 16y agoThe sentiment of the article is nice. Especially the part about feeling self-conscious and stupid. People need to remember that (myself included). I'd also add that often people online can excascerbate (sp?) the problem. "What, you don't know how to write an O(n) gnome sort!? Dude you are not a programmer." It's really easy to forget that not everyone is an elite CS programmer who graduated with a 4.0. And not everyone needs to be. Learning is a process and one we should help each other with. That being said, I'm one of those totally wrong people who disagrees with: You're lucky to have stumbled across a very good first language, but you're likely to encounter developers who will tell you that this decision doesn't matter. These people are wrong, plain and simple. You won't know what's good and bad about your first language until you try a few others anyway. So don't sweat it. I'd say, avoid zealotry and dogma. Program in as many languages as you can handle.
- sp4rki 16y ago"As a linguistics major, you're no stranger to the idea that a person is only capable of having thoughts and ideas that can be expressed in their language." This is, IMO, so wrong on many levels. My native tongue is Spanish, but I'm also fluent in English, French and German; however I find myself thinking in all of them with the exception of German (I guess I'm not as fluent as I thought I was in it ;)). In the same way, I started with C when I was around 12 years old, and I've had no problem thinking in C, Java, Ruby or Python (which are the languages I use mainly). I think as long as you understand the language itself you won't have to think back to a different one to process your thoughts. And don't get me started on the math. Math is extremely important in programming. I have a friend that shares that though that math is not important, and his code is hideous (Ok he uses ONLY Php, as it's his opinion all other languages are complicated and inflexible). Math can help you accomplish a plethora of things easily, faster, and more productively.
- sdasds 16y ago"As a linguistics major, you're no stranger to the idea that a person is only capable of having thoughts and ideas that can be expressed in their language." I am sorry but this is bullshit, I am glad I no longer visit this crappy forum filled with linguist turned Ruby Dev masquerading as Software Engineers and Computer Scientists. If you have an idea and if you can make it run on a machine, then it means you can convert it into the machine code, which is what everything gets finally converted into. Also if this guy knew math it is called as Turing Principle and as long as the language is Turing complete it makes no difference.
- Natsu 16y agoAgreed. It makes it sound like we cannot come up with new ideas or new words, which we all know that we can. My first language was a form of BASIC. Then I mostly programmed on my calculator in another BASIC-derived language not far removed from assembly (GOTO was the only flow control it offered). When I moved to C, suddenly the patterns of if/then and do/while/for loops immediately made sense: I had been using them the entire time without realizing it. And math? I can't help but use it. When people ask for estimates, I always do some math based on known quantities rather than just guessing. I keep track of how far off my estimates were to apply later corrections and reason backwards to figure out which of my assumptions were wrong (leading to better estimates in the future). I've done merge sort by hand on stacks of paper (and found the speedup when you have a big gap between two merged piles and can move an entire chunk to the sorted pile). And that's not even counting my job, where I end up doing lots of geometry. Knowing the formulas for mutually tangent circles or the formula to find the two intersection points of two circles is surprisingly useful (the case where you have zero or infinity intersection points just doesn't come up and even having one point multiplicity two is rare). I wish I knew more math. I know more than most people and I even have a degree in it, but there's so much great stuff like linear algebra, statistics, graph theory, and game theory that I never feel like I know enough about any of them.
- faragon 16y agoNot that hard. It is like other professions: you need skills and intelligence. With a strong math and computer science knowledge base, plus 10 years of programming experience, should be enough for addressing most difficult problems.
- moron4hire 16y ago>> Language does matter. I would say "Languages do matter. All of them." Now, I certainly don't mean iterations on a single language (though experiencing that evolution first-hand can be very instructive), but insofar as Java 1.3 and C# 1.0 were nearly identical languages, they were still worth learning even at that time because experiencing the vastly different ecosystems completely cuts through all of the dogmatism that every language has.
- jamii 16y agoDeveloping code, especially complicated algorithms and data structures, is all about proofs. Not long, formal proofs but the kind of informal proof you do in your head to convince yourself that your code will work. Studying maths will give you a hell of a lot of practice working with proofs and exposure to lots of different ways of proving things. Even if I didn't use any of the material I learned that will still be valuable.
- DanielBMarkham 16y agoFurthermore, the first language you become comfortable with will influence the way you learn other languages in the future. This is true until you learn enough, then it's not true any more. I used to work with a guy who learned FoxPro (an old database program). Every problem we had on the team, he would look around and say, "Hey, you know what? We could solve this very easily if we only used FoxPro" Everybody is like that. We just don't see it. So the author is correct as far as he takes it. The difference is, once you've become exposed to bunch of languages and problem-solving paradigms, you start to see patterns. And once you see the patterns, the languages aren't that important anymore at least in the way you approach solutions. The coding itself may be more or less gnarly, but the way you go about fixing the problem is based on principles, not language constructs. This is like when you learn a word processor. The first time you use one, you begin thinking of all word processing problems through this one lens. But once you learn 3 or 4 word processors, it's all kind of the same. Programming is just like that, only it takes about ten times longer. I'd also note that no matter what tool or problem you have, if you keep refactoring and clarifying your code, you always end up in mostly the same spot -- some kind of DSL-ish place. That's true no matter what language you're using. So yeah, he's right. But not really. Instead of focusing on which language you start with, focus on broadening your programming experience. Got enough language zealots in the world. No need to make more.
- albertzeyer 16y ago"Besides, computers are way better at math than you are anyway." <- This is so wrong (at least until we have strong AI). He confuses math with doing calculations.
- zb 16y agoYes. As a mathematician colleague of mine used to say, "It is not the job of a mathematician to perform basic arithmetic. It is the job of an accountant." Usually in response to screwing up some basic arithmetic, as I recall ;)
- Jach 16y agoThis article came up before (original http://news.ycombinator.com/item?id=1053753 http://news.ycombinator.com/item?id=1053753 ), I'm going to quote Eliezer Yudkowsky ( http://news.ycombinator.com/item?id=1054201 http://news.ycombinator.com/item?id=1054201 ): "Look, I'm sorry to be the one to break this to you, but if you have difficulty with any programming concept, you must not be a supergenius. You're just an ordinary genius at best. I'm sorry. Life isn't always fair. Of course, I say this as someone who hasn't yet tried to learn Haskell. On the other hand, I know someone who competes at the national level and I never saw him have trouble with anything including Haskell, so... The sad truth is that there are some people for whom programming comes as naturally as thinking, with code formed as easily as thoughts; and if it takes an effort to understand any aspect of programming, you have just learned that you are not one of those people. Alas."
- seestheday 16y agoI'd like to add: becoming a programmer fundamentally changes your personality and who you are. Seriously.
- olliesaunders 16y agoI think this is true but I think a lot of us on HN are either too far gone or started too early to realize.
- webuiarchitect 16y agoLooking at all these comments. I see, people like to argue a lot; some of them just for the sake of it. I think we should always read an article from the writer's point of view. That won't suppress all our mismatched feelings but will certainly reduce it to a great extent.
- timinman 16y agoThe language you choose to start with is important. You should start with Ruby because it is less hard (and pretty useful).
- AndrewS 16y agoCompared to what? Your comment is like saying "A house is bigger."
- phatbyte 16y agoWhat about physic ? I think they also have an important role in programming and no, it's not just for games.
- Kliment 16y agoPhysics is extremely useful in terms of making models of reality. It requires somewhat different ways of thinking in comparison to math, but is no less useful to a programmer. Of course, if you are building things that interact with the real world, it's invaluable.
- Dn_Ab 16y agoTwo things. Programming is too broad an umbrella of a term for any meaningful generalizations to be made from it. It ranges from artisan type crafts work to engineering to pure mathematical theorizing. You can't tell the people doing machine learning, signal processing or physics engines that they won't need maths. That is just pure sillyness. It is very context specific. ---Second thing--- This person misses the point of math. Its not about arithmetic, its not about calculus or group theory or combinatorics or even numbers or proofs. No. those are by products. The true point of maths is about distilling observations of past patterns into their essence and core attributes. Packaging them and then using them to lay the foundation to think more complex and less intuitive thoughts. Not unLike libraries in programming. Look at the history of the developments of mathematics - shoulders of giants and all that. Abstraction. Maths is a creative endeavour and If we had more memory and faster thinking speeds and less fallible intuitions I dare say I doubt our maths would be so 'advanced', abstract. A lot of this would be built in everyday thinking, maybe this is related to why many programmers think they don't need maths - the mathematical principles of why what they do works and its mathematical nature may not necessarily need to be made apparent in order to get by. Or perhaps this is just a reflection of the youth of the field. But I do believe though that our maths is so advanced only because we are so stupid!