Re: Why do programmers start counting from 0?

From: Tore <tore.trollsaasXATX_at_skedsmo.online.no>
Date: Sun, 12 Dec 2004 08:30:06 +0100
Message-ID: <d8snr01h9isckvs96au62jflgcjpvtmut0_at_4ax.com>


On 8 Dec 2004 19:07:20 -0800, timothychung_at_gmail.com wrote:

>One day, I started wondering why we start counting from 0 and couldn't
>find a good search string to get much out from google.com. Can anyone
>help me?
>
>One of the advantage I can think of is modulus of that number gives a
>more organised result.
>
>Or is it just because of binary representation of our number?
>Please help. Thanks. :)

Believe this is the answer...
In the old assembler days, elements in an arrays were referenced by start-of-array-address and and offset value. Offset = 0 obviously pointing to start of the first element in the array. This technique was inherited by most of the machinecode-near or academic/university developed languages and then carried on from there.
Other, more business related languages, started counting from 1.

Regards Tore Received on Sun Dec 12 2004 - 08:30:06 CET

Original text of this message