[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: 1-based indexing in Lua
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 3 Apr 2018 12:39:46 -0300
> 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.
If we are to follow that kind of argument, I am sure we will find plenty
of reasons to dump decimal numbers from programmig languages in favor of
hexadecimal numbers: faster to read/write, shorter, full control of each
bit, etc; clearly superior.
For some strange reason, however, most languages still support decimal
numbers, and even stranger, most programmers still use them. Come on,
we are programmers, not children any more. Let us start counting zero
to F, instead of 1 to 10.
As a more concrete example, the floor division is way superior than the
round-to-zero division used by C and copied by many languages. But I
don't hear people whining all the time about division in those languages.