3 ms·
Yes, single letter variables do have their place. But this place is very limited. Consider these lines in ruby data.reject{|e| e.value.nil?} data.reje
by maze-le 8y ago
Yes, single letter variables do have their place. But this place is very limited. Consider these lines in ruby
data.reject{|e| e.value.nil?}
data.reject{|element| element.value.nil?}
I would always prefer the first one. My general rule of thumb is: If a variable has the scope of exactly one line, or if it is an incremental counter, use one letter.
- nailer 8y agoI just read it and thought 'e' was an error.