Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Mikhail_K
on Jan 20, 2021
|
parent
|
context
|
favorite
| on:
Again on 0-based vs. 1-based indexing
Negative indices are bug-prone. If you mess up iteration bounds, you should get an error, not silent incorrect indexing.
robertlagrant
on Jan 20, 2021
[–]
Can you give an example?
Mikhail_K
on Jan 24, 2021
|
parent
[–]
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: