4 ms·
This is silly. Different domains have different needs. If you think of arrays as pointer + offset calculation, and your only for loop has an explicit index incr
by Certhas 7y ago
This is silly. Different domains have different needs. If you think of arrays as pointer + offset calculation, and your only for loop has an explicit index increment in it, then starting at 0 is natural. If you are a systems programmer then a language targeting you should accommodate that.
If you are anyone who doesn't want to care (too much) about how things are implemented, then it's a lot less error prone to mark the 1st element of an array a[1]. Having taught and written fairly complex scientific code in both 0 and 1 indexed languages, there really is no good reason to do anything else.
for a in array[3:6]
Should iterate over the third to sixth element of the array.
- metalliqaz 7y agoI dunno man, it's Dijkstra's essay. He has a pretty good reputation.