You Don't Have To Be Good At Math To Learn To Code
HughPickens.com writes: Olga Khazan writes in The Atlantic that learning to program involves a lot of Googling, logic, and trial-and-error—but almost nothing beyond fourth-grade arithmetic. Victoria Fine explains how she taught herself how to code despite hating math. Her secret? Lots and lots of Googling. "Like any good Google query, a successful answer depended on asking the right question. "How do I make a website red" was not nearly as successful a question as "CSS color values HEX red" combined with "CSS background color." I spent a lot of time learning to Google like a pro. I carefully learned the vocabulary of HTML so I knew what I was talking about when I asked the Internet for answers." According to Khazan while it's true that some types of code look a little like equations, you don't really have to solve them, just know where they go and what they do. "In most cases you can see that the hard maths (the physical and geometry) is either done by a computer or has been done by someone else. While the calculations do happen and are essential to the successful running of the program, the programmer does not need to know how they are done." Khazan says that in order to figure out what your program should say, you're going to need some basic logic skills and you'll need to be skilled at copying and pasting things from online repositories and tweaking them slightly. "But humanities majors, fresh off writing reams of term papers, are probably more talented at that than math majors are."
I spoke to a computer science professor about 2–3 years ago who said he had noticed a curious thing over the last few years. The students in his classes didn't seem interested--or even willing to--in solving programming problems. They just expected to be able to come in, download this framework and that framework, find a solution to a tricky problem on Stackoverflow (or wherever), and maybe write some really rudimentary code to just glue the bits together. Many of the "old " assignments--implement three different sorting algorithms and compare their properties just seemed totally archaic to his students--why would you ever want to actually write a sorting algorithm? After all, somebody out there has already done it better, and that's nothing you would ever need to do as real programmer.
The professor was somewhat alarmed by this, but not totally in disaster mode, because it was probably true that MOST of his students would never need to write a sorting algorithm. Most of his students would never need to implement an algorithm that draws a circle, etc. But still--this was computer science--not community college.
The writer here seems to fall squarely into this class of learner. Honestly, the first thing this article made me think of was that awful Barbie learns programming book where Barbie gets some other people to write the code for a program she designed, thereby becoming a real computer programmer. Maybe the book wasn't that far off the mark after all...
Indeed, she thinks that 'script kiddy' = 'coder'.
Possibly true for very small values of 'coder'.
Faster! Faster! Faster would be better!
Ok, so you can do a lot of coding without knowing math.
But being able to understand code and coding requires a lot of the same skills that are required to understand math. Ergo, if you can get good at math, there is a high likelihood that you can also get good at programming. And vice versa. You can do long division without knowing a lot of math, but that doesn't make you a mathematician.
I am not your blowing wind, I am the lightning.
Certainly, not every programmer with a strong background in math is like this. But I've worked with people who are proud of their math ability, and who would be the first to tell you how critical math is to programming, who write terrible code. And I think their math ability may be at the root of the problem. I've decided that the kindest thing I can assume about them is that they're, perhaps, math savants.
They pride themselves on their "uncommon" ability to keep lots and lots abstract details "in their heads," and in their "analytical" skills. Their ability, I imagine, encourages them to write their programs as one big ticker tape, and their programming suggests they have no idea of how to name variables, much less compartmentalize. Next, they "debug," which translates to running their coughed up hairball of code through the debugger, iteration after iteration, until they've finally straightened it out and "got something working." And, then, that's the end of it for them—program, done.
I would much rather work with someone of either more modest math ability, or someone who, in addition to their math ability, had some idea of how to communicate (which, I think, is a critically important skill to a good programmer). That person might actually have a chance of writing maintainable code, instead of producing a "class" that's 5,000 lines long with 30 instance variables, and a 7 or 8 methods all marked "static."
quiquid id est, timeo puellas et oscula dantes.
Who needs fucking math when you can Google?
There are lots of answers that a professional (read as highly paid) programmer might need math. If you want to make the big bucks, you want to work at google, or do embedded programming, you're going to use advanced math once in a while. A great example is a problem I recently faced. I needed a heating device that consumed 2kwatts average power, and to make it as cheaply as possible, it needed to do so directly from 110V AC. The heater core had a very low resistance, so it needed to be PWM driven, with a sensor to turn it on and off based on the instantaneous line voltage. When the mains were below a certain voltage, it would turn on the current, and when it was above that amount, it would turn off. So now the problem is, for 2kW average power, what is the approximate cut off voltage. This needs to be within about 5 volts plus or minus so that we can pack all of our available sensor range into that small range to get very accurate outputs.
I could spend a week using trial and error, and blow up several hundred dollars worth of parts getting it wrong, or I could spend 2 hours doing the calculus to get the actual answer (I'm pretty rusty at calc, and came up with an absurd answer on my first attempt). My boss hired me, and I make a lot of money because I could handle problems of this calibre. If all you want is a 35k / year job then not knowing math is fine, but if you want a career with a future, then the math is critical. Math doesn't make products work, it makes them cheaper to build and cheaper to design, and as a programmer, your value to the company is a function of how big a difference your work product makes to the bottom line. The more money the company has at the end of the day because of you, the more money they will pay you to be there.
I wish I had a good sig, but all the good ones are copyrighted
Sort of. Many specific math classes aren't necessary, but most advanced programming has very close similarities to math. For example, graphs are used extensively in a wide variety of more involved coding, and graph manipulations are pretty mathematical. The thinking processes underlying most other algorithms are extremely closely-related to the thinking processes required for math.
Also, if you're going to be doing any sort of mathematical calculation using code, there's no way you're going to be capable of properly debugging the code if you don't understand the math.
I guess I like that she's saying that you can code even if math scares you, but all this says to me is that she had crap math teachers. If you can do a decent job of coding, you can learn math. It's just a question of finding the right learning methods.
Math is a tool like a hammer or a screw driver. A carpenter typically does not love their tools, but they sure know which one to use with a nail or a screw.
Math is being taught wrong. Most math teachers love their subject and do not understand why the students do not also love the subject, when they provide no practical use. Practical uses are many, such as amortization, 3D physics accurate simulation, and robotics.
For example, I teach typical HIGH SCHOOL students bubble sort, then merge sort using recursion in GCC. We then create a list of 1,000,000 fake names using "rig", and temporarily replace the /usr/bin/sort program with our own, discussing the big O.
The students typically enjoy these assignments as they begin to understand the GNU tools, and have a practical use for both math and logic. The problem solving process and application of new concepts are valuable whether or not students will ever write a sort program again in their lives.
Not necessarily just about care. Many people can get pretty bad anxiety about math due to the way they were taught. Especially if they just fall behind a little bit at one point, because math tends to build on previous things, it can become really difficult to catch up. All they need is one bad class and they may never make up for that deficit, with the way education in the US is currently structured.
Certainly, not every programmer with a strong background in math is like this. But I've worked with people who are proud of their math ability, and who would be the first to tell you how critical math is to programming, who write terrible code ... They pride themselves on their "uncommon" ability to keep lots and lots abstract details "in their heads," and in their "analytical" skills.
Throughout elementary, middle, high school and even into college (dependent a bit on major), we tell kids that "math" is learning your times tables, balancing a checkbook, and basically arithmetic skills. There's some algebra thrown in there in high school but for the most part, most people think of math as doing arithmetic. I'll give you an example. My mother says "You're so good at math!" whenever she's baking cookies and asks me how much flour to use if she wants to double the recipe and she typically uses 1/3 cup of flour. This isn't unusual; I heard this all through my life, from family, friends and even teachers.
Mathematics, however, is really just logical thinking. It is the art of logical reasoning about problems. Often applied to numbers, sure, but it doesn't have to be, or at least not in a concrete sense. It's more about reasoning about patterns, abstracting different types of problems (realizing that two problems you thought were different are actually the same type of problem!) There are whole college courses in mathematics I took back in the day where not a single number was written on the board. It was all symbols and functions and proving properties of things (meaning: what can I logically conclude about something based on this list of facts?). Being good at math really means being good at reasoning about problems, abstract away the difficulty, and notice patterns.
I think the disconnect is that there is a healthy population of people running around that declare themselves "good at math" because everyone they know (family friends teachers) tells them they are good at math... because they did arithmetic and basic algebra well. The end. I've met several people like that. Doing those things at a high school level is more about memorization (think: memorizing times tables, memorizing "FOIL" method for multiplying polynomials, memorizing quadratic formula, etc.) than logical reasoning. You might get a taste of that in high school geometry if you're lucky, but honestly even that seems to mostly be "memorize this proof about geometry" without really building logical reasoning skills that can be applied to other problems. You just do it for the sake of doing it, from the students' perspective.
The people that are "good at math" you meet that suck at programming are likely the people that fall into this category. They were great at K-12 math classes because they can memorize and hold a lot in their head, and they probably learned programming by the same method -- look at code (in a book, google search, whatever) and memorize the code. They memorize what functions do what, and how to throw things together, but they never really internalized that abstraction and problem solving that a true mathematical mind has. So they never really learned how the code goes together, or why one pattern is better than another. They just memorized an approach that worked in the past. I've seen a lot of that too unfortunately.
A real college level course in mathematics is really eye-opening (likewise, I think physics majors and a few others also experience this), and I think that ability to reason abstractly really does make a huge difference in how you approach problems. Even if you never directly use your math classes at your job, having gone through those classes permanently change how you think about and approach problems, and I think that is a huge benefit. It's a shame most people -- even the ones "good at math" -- never take one of those classes.
When I was in hobby programming, I was advised that Combinatorics is necessary for learning (at least basic) algorithms, but combinatorics require some set theory, linear algebra, and group theory. Computer graphics, I thought linear algebra is enough. But modern CG requires also calculus, digital signal processing, etc. Digital signal processing require mathematical analysis, probability, calculus. Computer vision requires knowing statistical mathematics, but to understand statistic, one must understand probability, which requires at least mathematical analysis.
My experience base on reading different maths textbooks:
USA:
Books aim at advanced students, (not all but almost) are likely encyclopedia. It's not that the material is hard, but the structure of the books is hard to follow, or not explain very well.
Books for novice, for the masses, the "introduction/dummy" type. To describe this type of book: wordy and dumb. Endless explanations of trivial things, and strip, dump down necessary, important one to make it 'easy'. Beside of that, some 'favorite' authors like to write useless jokes in textbooks (It may be good thing if they do it when they lecture in a class)
Soviet/European (mostly Soviet textbooks): maths books should be.
Also, Soviet textbooks for novice are drastically different from USA ones. They use highschool level maths to explain advanced maths. The books are almost black and white, no jokes inside, but interesting read.
I've done quite a bit of 3D graphics work, and I strongly disagree. You need very little. You say "Linear algebra (matrices) and trig" but you don't need much beyond what matrix operations to apply to achieve some goal (you need to actually understand very little, and far less if you use a matrix library) and soa cah toa on the trig side. Just about every major problem you'd encounter has a near standard solution.
Calculus and differential equations are need for doing simulations of physical processes
This is a bit outside my experience, as all I've done there is a 3D physics engine for a game. Even then, I suspect all you need to know are the equations and a few well-understood approaches to integration, actually understanding the math (or the physics) doesn't seem necessary. (Though I'll admit that it is helpful.)
You can be an excellent programmer without strong math skills, even in some areas where a solid understanding of mathematics would seem essential. I'd even argue against the need for a strong background in logic. If Slashdot is any indication, most developers don't understand even basic logic. They've simply confused their rudimentary understanding of Boolean algebra with a complete understanding of formal logic.
This isn't to slight developers, on the contrary. It's art, after all, not engineering. Be proud that you've mastered a skillful discipline.
Required reading for internet skeptics
Ignorance should never be treated as a virtue. And yet that is what is happening and this original post proves that this attitude is still alive.
Yes, still alive.
Not to sound like an old fart, but this is a very old problem that won't go away. It's easy to be frustrated by the infinite well of stupidity -- the human fate to play whack-a-mole with idiocy. For all the progress (including amazing tech) there's a tail in our intelligence distribution that is retrograde. Worse yet, there's a fraction in the intelligent part of the distribution that is cynical or lazy or evil.
To be clear, I agree with you. Stupidity pushes my buttons too. I differ in that I don't think it's a problem exclusive to modern society. I'm pretty sure that there never really "used to be a time when learning stuff was considered important" *in the sense* that most people thought that way. Rather, I think we've been lucky to benefit from the smart and non-cynical people who have, by virtue of their creativity and (perhaps, accidental) generosity, given us pretty usable tools of agriculture, commerce, art and humor to work with. Of course, those tools only work well for some of us and the negative side of those tools can be downright nasty to those without the means of most slashdot readers.
My point is that in spite of the large number of morons, I don't want to let that sap the infinitesimally small amount of good I just might be lucky enough to do without also, possibly, messing up in some colossal unintended way.
Peace.
I can only count one job out of about 2 dozen in thirty years where I had to multiply vectors. And this includes a few NASA subcontracts that I've been on.