Skip to content

Comment on Math topics useful for computer science/programming

Comments

"Many students struggle with the idea of recursion..."

I still remember one of the worst bugs I'd ever introduced (in terms of pain to me). I was maybe 2-3 years out of my bachelors, and I thought recursion was so nifty that I'd use it where ever I could. I was coding C++, at the time. And, I got the dreaded 2am call after all of the production servers went down hard. Like terminate and corrupt data hard.

Lesson learned: it's good to know recursion, but it's also good to know maximum stack sizes.

There's also thunk/trampolining continuation style to convert recursion easily into something that is not stack limited. http://nathansuniversity.com/cont.html

What problem were you trying to solve with recursion?

That and tail-call optimisation :)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.