3 ms·
The key modifying phrase was "for short block/method parameters." The authors aren't advocating one letter variables throughout your code, only in situations li
by kshipley 15y ago
The key modifying phrase was "for short block/method parameters." The authors aren't advocating one letter variables throughout your code, only in situations like:
[1, 2, 3].each { |e| puts e }
Object.methods.each { |m| "Method is: #{m}" }
- michaelchisari 15y agoEven as such, using full words is barely any more typing, and more readable. [1, 2, 3].each { |value| puts value } Object.methods.each { |method| "Method is: #{method}" } I consider that a better habit to have than using single-character variables. And style guides should be about encouraging the best habits possible.