Hacker News new | ask | show | jobs
by bitfury 3985 days ago
A good foundation in math is imperative (if you're serious about programming). Sure, anyone can pick up syntax but can you program, that's the question. In my experience, it's what makes a difference between a good or bad programmer.
2 comments

Couldn't disagree more. A recent link on HN was along the lines of "ability to mange complexity is the key differentiator of a good programmer" and I think this is vastly more important.

Most code has very little mathematics in - beyond the core skills of recognising patterns and abstractions. If that's all you mean by 'a good foundation in mathematics' then we agree but I don't think your formulation is terribly useful.

Code does not have to have mathematics for someone to have a difficult time writing it. By a good foundation, I meant being able to understand fundamental mathematical concepts such as those taught in discrete math. It's not a numbers class but it makes you use your brain in ways which help and facilitate the writing of code.
I wonder what you mean exactly by 'a good foundation in math'. There are all kinds of programs you can write with the most basic of math knowledge.
I remember reading this years ago he explains my point better than I do:

"Most people think of math as doing arithmetic or memorizing arcane formulas. This is like asking if you need perfect spelling or an extraordinary vocabulary to be a good writer.

Writing is about communication, and math/programming is about the process of clear, logical thinking (in a way that you can't make mistakes; the equation doesn't balance, or the program doesn't compile). Specifically, that logical thinking manifests in:

Ability to estimate / understand differences between numbers: O(n^2) vs O(lg(n)), intuitive sense of KB vs MB vs GB, how slow disk is compared to RAM. If you don't realize how tiny a KB is compared to a GB you'll be wasting time optimizing things that don't matter.

Functions / functional programming (is it any coincidence that the equation f(x) = x^2 is so similar to how you'd write that method? The words "algorithm" and "function" were around in the math world far before the first computer was born :-))

Basic algebra to create & reorder your own equations, take averages, basic stats

So, I'll say you need a math mindset, being able to construct & manipulate mental models of what your program is doing, rather than a collection of facts & theorems. Certain fields like graphics or databases will have certain facts you need also, but to me that's not the essence of being "good at math".