4 ms·
Negative indices are bug-prone. If you mess up iteration bounds, you should get an error, not silent incorrect indexing.
by Mikhail_K 6y ago
Negative indices are bug-prone. If you mess up iteration bounds, you should get an error, not silent incorrect indexing.
- robertlagrant 6y agoCan you give an example?
- Mikhail_K 6y agoSure. Let's take array elements in reverse, from m to m-n. Suppose n erroneously becomes larger than m. That should produce an error, not silently take several tailing elements.