Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
kpenc21327yIf yours is more readable then it's better. If the other one is idiomatic then it's better.
-
Crazed20507yI once had a project that I had to do in F# and I found a Marge sorry online that took 35 lines. I had no clue how it worked because F# is impossible to read, but it did work.
-
Root825577yThis is what Ruby is like, though 😊 and it's why the language is so wonderful.
It's easily readable (generally) and succinct. -
stisch48147y@Root I agree, I love Ruby! It seems to always surprise me.. just when I thought I've mastered it I find some awesome trick I didn't know existed
-
Root825577y@stisch that happened to me with Rails a few weeks ago. I didn't know about `delegate`! It looks incredibly useful.
I also didn't know you could chain sugars in Ruby. Ex:
a=1 and b=2 if c==3
As you'd expect, it does both assignments if the condition is met, otherwise it does nothing. It can be a bit verbose/ugly on longer lines, but quite useful for readibility on large blocks of similar lines.
I ended up refactoring this out of my code, but it's neat that it works!
Related Rants
-
Badr9When I Googled a problem I faced, and found a YouTube video solving it, then tried to thumb 👍 it up, but Yo...
-
ogzet16That weak moment when I googled “how to invert a boolean”
-
baskoros244+ years of programming. Still have no clue how to make my own regex pattern. Every single time I need to, I...
Someone's 3 lines of Ruby that do the same thing as my 30 lines.
rant
wk88