News for hackers. Stuff that matters.
Re:Once you go functional, you can never go back by xamuel on Monday May 18, 2015 @09:12AM (#9564202)
In the example in question, the author compares apples to oranges: an imperative iterative Fibonacci print-first-n-fibs vs. a functional recursive Fibonacci return-nth-fib. An imperative recursive Fibonacci return-nth-fib would be far closer to classical mathematical notation.

A good way to cut through the ideological BS is to look at how mathematicians write pseudo-code. It's almost always either pure imperative, or imperative with a tiny smattering of OOP/FP stuff (no thicker than you'd see in a sophisticated C project).

Re:Once you go functional, you can never go back by jjaredsimpson on Monday May 18, 2015 @09:27AM (#9564260)

    int fib(int n)
    {
    	return (n <= 1) ? n : fib(n-1) + fib(n-2);
    }