4 ms·
It can happen accidentally quite easily. Someone new to a codebase starts hacking in a feature and mistypes a variable as 'value' instead of 'values'. They fa
by tdicola 11y ago
It can happen accidentally quite easily. Someone new to a codebase starts hacking in a feature and mistypes a variable as 'value' instead of 'values'. They fail to realize there's already a 'value' variable in the global namespace (perhaps it's a gigantic spaghetti code mess of a file). They don't have good test cases that exercise this exact line and fail to see the bug. Code ships to production, three months later the line runs and explodes.
- maehwasu 11y agoYour example is quite good, although there are far more bulletproof ways than exhaustive test cases to make sure this doesn't happen.