3 ms·
I think with "shortcuts" they mean things such as $1 (first match group of a regex) or =~ (regex match operator). I general I rarely feel like I am unproductiv
by oezi 4y ago
I think with "shortcuts" they mean things such as $1 (first match group of a regex) or =~ (regex match operator).
I general I rarely feel like I am unproductive in Ruby (or bogged down in boilerplate typing).
- cycomachead 4y agoIn that case -- I definitely agree Ruby usually gets out of way. It's often my go to for hacking on something, unless it's data science-y. I'll mention: implicit returns, return if, and safe navigation, the &. operator. Ruby's newer pattern matching features are really cool[1], especially for things like JSON structures, but I've only use started using them. Classes are also super easy to extend. Many of these things are also incredibly easy to abuse - but they have their places. [1]: https://docs.ruby-lang.org/en/3.0/syntax/pattern_matching_rdoc.html https://docs.ruby-lang.org/en/3.0/syntax/pattern_matching_rd...