3 ms·
Huh, I use `$1` all the time, and see it all the time. Probably because the alternative with an explicit match object ends up being relatively a lot more code a
by jrochkind1 11y ago
Huh, I use `$1` all the time, and see it all the time. Probably because the alternative with an explicit match object ends up being relatively a lot more code and a lot harder to read, really.
If avoiding `$1` has been often recommended for a while... I think it's a recommendation more often ignored than followed.
- thescrewdriver 11y agoI've never seen $1 used in production code.
- Freaky 11y agoTry grepping your lib directory sometime. In fact, let me do it for you, on a relatively clean install: time, benchmark, irb, pry, rubygems, resolv, erb, rake, open-uri, debug, rack, cgi/util, optparse, getoptlong, bundler, activesupport, actionpack, activemodel, erubis, slim, haml, sass, sequel, roda, nokogiri, rugged, faraday, mime-types, thor, test-unit, tzinfo, mail, ffi
- deleted 11y ago[deleted]
- thescrewdriver 11y agoOuch. That's pretty awful.