3 ms·
The scientists can do what they want until they start using computers, then they should listen to the software engineers.
by metalliqaz 7y ago
The scientists can do what they want until they start using computers, then they should listen to the software engineers.
- Certhas 7y agoThis 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.
- deleted 7y ago[deleted]
- contravariant 7y agoNah everyone should just listen to the mathematicians and allow for arbitrary index sets. Seriously though you save yourself a lot of trouble if you don't worry that much about what range your indices have but rather what they represent. The fact that they're integers starting at 0 is just an implementation detail.
- goatlover 7y agoSoftware engineers made the first high level programming language called Fortran, which starts indexing at 1 by default.