[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 1-based indexing in Lua
- From: Oliver Kroth <oliver.kroth@...>
- Date: Tue, 3 Apr 2018 15:25:17 +0200
Am 03.04.2018 um 15:02 schrieb Ahmed Charles:
Written before I was born, EWD831
(http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html)
describes why 0 based ranges are superior better than I can. It has
nothing to do with programming languages and everything to do with math.
Actually, Dijkstra just prefers to have items counted like 0,...,N-1
instead of 1,...,N
odd.
When I count things, let's say, cows, I start with the first cow and say
"one", second cow "two", third cow counted "three"...
I would not start with the first cow and say "zero", I say "zero" when
there is no cow at all.
A zero-th cow is the cow in the empty corral, and actually "not a cow"...
--
Oliver