Re:Iterators? They still make these?
by DjDarkman on Thursday June 17, 2010 @02:10PM
(#1439827)
It did not make sense back then, it does not make sense now. Even the traditional for loop is superior to iterators.
[ Parent
| on HN ]
Re:Iterators? They still make these?
by RodgerTheGreat on Thursday June 17, 2010 @03:59PM
(#1440173)
Can you implement a tree traversal (in-order, post-order, your pick) in a traditional for loop without abusing the syntax?
Sure 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.
For loops are not a general replacement for iterators.