Has any consideration been given to using @
(or another sigil) as an alias for self
?
This is done in Ruby and a number of the JavaScript based languages offer it as a replacement for this
.
That is, prod = self.a * self.b prod = @a * @b
are equivalent.
I often view sections of rust code where every line has one, two or three self
on it. This takes up significant horizontal space and creates visual clutter.
Using @
instead of self.
is one character instead of five and still provides a readable, easily understood means of making member access explicit.