Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Negative indices are bug-prone. If you mess up iteration bounds, you should get an error, not silent incorrect indexing.


Can you give an example?


Sure. 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: