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."
(Score: 2) by martyb on Thursday September 03 2015, @12:35PM
Mathematics is a very broad field which does include numerical calculation. But it is far more than just that! Boolean algebra. Set theory. Algebra. I regularly use all of these when I am programming.
At its simplest, an algorithm is a mapping of inputs to outputs. Or, more specifically, a mapping of a domain to a range. Let's look at a simple program to calculate an average for a user's grades for a semester. Input is a string of blank-delimited grades. Output is the average. Simple and straightforward, right? This example is in AWK.
Let's test it with a couple of samples of test data:
Looks good... ship it!
But, it fails.
There is no input checking. It returns a non-integer in many cases. Non-numeric 'grades' are treated as having a value of zero. Worse still, the program crashes on a null-input with a divide-by-zero error.
I would argue that one needs to know what the entire domain of possible inputs is and needs to be able to accurately parse that into non-intersecting subdomains that cover the entire of the input domain. Further, one then needs to be able, for each of those subdomains, perform the correct processing and generate the correct results.
These are not difficult concepts. I learned set theory in 5th grade, algebra in 7th, and Boolean algebra as part of a programming course in 8th grade. But, I have had a successful career in software test and quality assurance because these simple concepts constantly fail to be fully implemented by developers!
An aside. For those who know this already, it's no big deal. But until I learned these, conditional expressions were just a miasma of quirky symbolisms. Sadly, it seems, there are many professional programmers who are unaware of these!
The Boolean operator 'AND ' is just multiplication on the domain of {0, 1}:
Further, Boolean 'OR' is just addition on the same domain, where one defines 1 + 1 to have the value 1:
Combine this with the rules of associativity, distribution, and commutation and even the most convoluted conditional expression can be evaluated. =)
Wit is intellect, dancing.
(Score: 0) by Anonymous Coward on Thursday September 03 2015, @02:04PM
tl;dr - Error checking and exception handling takes up a lot more time and code than the basic task at hand. This requires the programmer to understand the requirements rather than just the math, but some parts of the programmer's skill-set for checking/handling these issues can be compared to basic math learned in grade school.