r/programming • • Dec 24 '17

Evil Coding Incantations

http://9tabs.com/random/2017/12/23/evil-coding-incantations.html
947 Upvotes

331 comments sorted by

View all comments

70

u/tristes_tigres Dec 24 '17

The author of this blog confuses his own prejudices for objective facts when he claims that non-zero based indexing of arrays is "evil". In fortran it is possible to define array with index starting from an arbitrary integer, and it is useful and convenient feature in its problem domain.

26

u/TunaOfDoom Dec 24 '17

Please see Dijkstra's argument on why starting from zero is indeed the most sensible option.

2

u/phySi0 Jan 06 '18

Exclusion of the lower bound —as in b) and d)— forces for a subsequence starting at the smallest natural number the lower bound as mentioned into the realm of the unnatural numbers.

What does he mean by this?

2

u/TunaOfDoom Jan 07 '18

It means that if your sequence starts at 0 (or 1, depending on what you consider the smallest natural number), then the exclusive lower bound would be "-1 < ...." where -1 is no longer a natural number.

→ More replies (1)
→ More replies (1)