User loginNavigation |
"The Anatomy of a Loop"What's better: recursion or iteration? This topic has been discussed to death on LtU:
Olin I-did-it-all-by-myself Shivers weighs in [PDF, 194K]:
In call-by-value functional languages such as ML or Scheme, we typically write loops using tail-recursive function calls. This is actually a terrible way to express program iteration, and it's not hard to see why. As was popularised by Steele, a tail call is essentially a "goto that passes arguments." So writing loops with tail calls is just writing them with gotos. Yet, it has long been accepted in the programming-language community that goto is a low-level and obfuscatory control operator, a position stated by Dijkstra's "Goto considered harmful" letter. By el-vadimo at 2005-09-30 17:37 | LtU Forum | previous forum topic | next forum topic | other blogs | 33919 reads
|
Browse archivesActive forum topics
|
Recent comments
1 week 4 days ago
2 weeks 1 day ago
2 weeks 2 days ago
2 weeks 2 days ago
3 weeks 1 day ago
3 weeks 4 days ago
3 weeks 4 days ago
3 weeks 4 days ago
4 weeks 6 days ago
5 weeks 23 hours ago