3 ms·
A while loop is only "recursion with tail-call optimization". It's not equivalent to "recursion without TCO". But "while (true)" is also equivalent to a goto
by AnimalMuppet 5y ago
A while loop is only "recursion with tail-call optimization". It's not equivalent to "recursion without TCO".
But "while (true)" is also equivalent to a goto :-)
While both of those are true, I'm not sure that understanding either of them is relevant to dmitrigr's claim that you have to understand both recursion and pointers in order to amount to anything as a programmer.
- earleybird 5y agoYou are of course correct and with respect to the claim "you can't be a good programmer without understanding indirection and recursion" I don't believe that holds water. I think different techniques allow for a deeper understanding; whether or not that deeper understanding translates to a "better programmer" is fairly subjective. For me, a good programmer is one who writes readable/understandable code and that's a different category all together.