4 ms·
The difference is the let key word makes it obvious you’re rebinding the name. Shadowing is one of those things that intuitively raises a red flag first time y
by pixel_fcker 7y ago
The difference is the let key word makes it obvious you’re rebinding the name.
Shadowing is one of those things that intuitively raises a red flag first time you see it but actually is extremely helpful. It dramatically reduces noise e.g. in functions where you take an input parameter and want to convert it to a different type to work with it. No more prefixing or suffixing the variable name, you just rebind it which makes the intent clear (at least to me).