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);
} int fib(int n)
{
return (n <= 1) ? n : fib(n-1) + fib(n-2);
}
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).