3 ms·
It did not make sense back then, it does not make sense now. Even the traditional for loop is superior to iterators.
by DjDarkman 16y ago
It did not make sense back then, it does not make sense now. Even the traditional for loop is superior to iterators.
- barrkel 16y agoFor loops are not a general replacement for iterators.
- DjDarkman 16y agoI didn't say we need to replace them, I said that we don't need them.
- RodgerTheGreat 16y agoCan you implement a tree traversal (in-order, post-order, your pick) in a traditional for loop without abusing the syntax?
- DjDarkman 16y agoSure you can, just list all your tree elements in an array, your iterator does that anyway. If done correctly it's 1 line extra code only. And btw: let's not confuse implementation with syntax.