4 ms·
Author here, nice! TIL :)
by softwaredoug 5y ago
Author here, nice! TIL :)
- stouset 5y agoI have written Ruby professionally for like fifteen years and I have not once witnessed a `for` loop. I’m genuinely confused as to where you picked this up. Enumerator and Enumerable are endemic.
- vidarh 5y ago~15 years here too, and I can't remember my last for loop either. I think for loops are mostly used in Ruby by people that picked it up in other languages first and simply never unlearned it.
- halostatue 5y agoAlmost twenty years here. I have definitely seen and used `for` loops, but they are the _exception_ and usually used in one-off scripts.
- xtracto 5y agoI would actually say that if I found a for loop in Ruby, it will be a code smell.