Hacker News new | ask | show | jobs
by JamesLeonis 1097 days ago
I lie to people about programming all the time.

I tell them it's not about math, you just have to think logically through every step.

With more steps comes more scrutiny, so you study how to optimize.

You will read papers about optimization to reduce the number of steps.

Those papers have a suspicious amount of math.

By the time you discover, "...wait, its all math?"

"Always has been."

What I personally found helpful was the book The Algorithm Design Manual [0]. It starts right off with math, but in a way that connects it to basic primitives of programming. You start building up an algorithmic understanding as you increase the computation complexity. It was very intuitive for me, both for understanding the math and understanding Big O in a rigorous manner. From there it dives into actual algorithms and code, but the math returns periodically.

[0]: https://www.algorist.com/

2 comments

I went through Algorithm Design Manual before learning Discrete Math[0]. Suffices to say, I had plenty of these "always has been" moments you're talking about :) The book is great at explaining algorithms, math prerequisites and all. Then you try the exercises, and they leave you with a subtle feeling of "hmm, perhaps there's more to this algorithms stuff". As an example, perhaps the first time I got this was in chapter 1, when I encountered the greedy pirates puzzle[1].

[0] Had plenty of books to select from. Kenneth Rosen's was the only one I liked. Knuth's Concrete Mathematics is great if you decide to give a subject a second go -- the material is somewhat different, more abstract, and the side notes by his students are hilarious.

[1] https://www.mathsisfun.com/puzzles/5-pirates-solution.html

There’s a lot more to programming than algorithms; so much so, in fact, that I’d say that the sort of algorithm optimization you’re talking about is one of the least important skills to study.