4 ms·
The downside is when reading code you’re keeping in your head information about the type of each variable. If you skim through the code and miss one of these re
by cillian64 4y ago
The downside is when reading code you’re keeping in your head information about the type of each variable. If you skim through the code and miss one of these redefinitions then you may be mistaken about the variable’s type.
That said, I still think sparing use of this is justified, especially with an editor which can show types on mouseover.
- jackosdev 4y agoThat’s true, but this has never been a problem for me looking through large codebases and doing code reviews, in other languages I was constantly annoyed by not being being able to shadow
- iudqnolq 4y agoYou've got to keep info either way. I'm more worried about forgetting let data = get(); let uniqueData = Array.from(new Set(data)); // ... (snipped many lines) process(data); // should have been uniqueData