3 ms·
It's also funny to sometimes see the same people who say goto is bad, use break and continue heavily in their loops. Which are only tad better than goto and oft
by pkolaczk 11y ago
It's also funny to sometimes see the same people who say goto is bad, use break and continue heavily in their loops. Which are only tad better than goto and often just as hard to read.
- kuschku 11y agoLoops in general are a problem. Tail-Recursive functions would be a far better solution. And almost every loop can be replaced with a simple map, fold, or filter.
- frik 11y agoRecursion can be expensive (call stack) depending on the language implementation. For example Lua 5.1 and recent JS implementations have a proper recursive tail call implementation. The Lua manual explains it: "Without proper tail calls, each user move would create a new stack level. After some number of moves, there would be a stack overflow. With proper tail calls, there is no limit to the number of moves that a user can make, because each move actually performs a goto to another function, not a conventional call." -- http://www.lua.org/pil/6.3.html http://www.lua.org/pil/6.3.html