5 ms·
I absolutely agree, interference with instance variable/method alias '@' looks awkward. For me it seems a little bit against Ruby-way.
by ololobus 8y ago
I absolutely agree, interference with instance variable/method alias '@' looks awkward. For me it seems a little bit against Ruby-way.
- vidarh 8y agoInstance variables can not start with a digit, so this works fine from that perspective.
- jimbokun 8y agoSo another exceptional edge case to learn.
- vidarh 8y agoGiven how little of Ruby syntax most people know before they're able to read and understand Ruby, I don't see that as much of a concern. "@" suggests it's probably local of sorts, the number makes it clear it's not an instance variable, and the absence of |somevar| in a chained block will strongly suggest it's an argument, without having to know the precise details. There are many additions to Ruby I don't care much for, but this is one of the most intuitive I've seen.