Re:Ruby vs. Python comes down to the for loop
by softwaredoug on Friday November 12, 2021 @12:03PM
(#29201645)
Author here, nice! TIL :)
[ Parent
| on HN ]
Re:Ruby vs. Python comes down to the for loop
by stouset on Friday November 12, 2021 @12:47PM
(#29202285)
I 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.
Re:Ruby vs. Python comes down to the for loop
by xtracto on Friday November 12, 2021 @01:22PM
(#29202761)
I would actually say that if I found a for loop in Ruby, it will be a code smell.
Re:Ruby vs. Python comes down to the for loop
by vidarh on Friday November 12, 2021 @06:13PM
(#29205605)
~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.
Re:Ruby vs. Python comes down to the for loop
by halostatue on Friday November 12, 2021 @02:08PM
(#29203305)
Almost twenty years here. I have definitely seen and used `for` loops, but they are the _exception_ and usually used in one-off scripts.