this post was submitted on 16 Sep 2023
557 points (94.1% liked)
Programmer Humor
19471 readers
30 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Not in ruby, the for loop was initially put there to make it friendly for people from other languages and is discouraged. It's just syntax sugar on top of
each
.By shortand version I meant
(although in this case I'm not calling
puts
anymore)edit: lemmy keeps putting the
&
there, but you know what I meanIt’s valid syntax, it’s part of Ruby. It’s easy to read and familiar across many languages. Write what you want to write, I’m not sure why you feel the need to finger wag.