Re:Is anybody else using ridiculously long variable names?
by MichaelGG on Wednesday August 17, 2016 @11:41PM
(#12310291)
Rebinding variables (let age = "123"; let age = int(age)) is excellent and it's a shame more languages don't let you use it. It lets you keep immutability while making sure an old value isn't used.
In Rust I've even started doing something additional which is use the shadowing feature. This was always a big no-no in other languages, some don't allow it, others do something different, but in Rust it can be used safely to reduce the explosion of variables in certain contexts. This helps reduce the need for distinctions between variables, allowing for shorter names.