News for hackers. Stuff that matters.
Re:PG on the cover of Forbes by axod on Friday November 19, 2010 @11:55AM (#1921877)
Loops are how most people think. They're also how most CPUs think.

It seems to me logical for both parties to express programs mostly using loops.

Re:PG on the cover of Forbes by timtadh on Friday November 19, 2010 @03:44PM (#1922726)
Except there is no difference at the machine instruction level between a recursive and iterative approaches. They are isomorphic to each other. That is why you can implement all recursive algorithms using an explicit stack and a loop and all iterative algorithms as recursive functions.
Re:PG on the cover of Forbes by axod on Friday November 19, 2010 @05:35PM (#1923093)
Huh?

There's a lot of difference in the unoptimized form of recursion - namely stack usage. Yes you can hack together tail call recursion to try and make recursion perform as well as iteration does, but what really is the point?

Re:PG on the cover of Forbes by eru on Monday November 22, 2010 @09:43AM (#1929896)
The concept of recursion in is independent of computers. Recursion is just the mathematicians idea of how to repeat get arbitrarily big objects out of limited definitions.

Loops are a just a special case, and not really closer to the hardware. Branches and jumps are closer to the hardware. "Yes you can hack together [a compiler] to try and make [structured programming] perform as well as [goto] does, but what really is the point?"