[fpc-pascal] a few trivial questions

Marc Weustink marc at dommelstein.net
Thu May 13 17:07:59 CEST 2010


Jürgen Hestermann wrote:
>> I personally hate 0-based counting because no
>> human counts 0, 1, 2 etc.. so why must computers? 
> 
> Yes. That's my feeling too. Zero-based arrays/lists always generate 
> trouble because of substracting or adding one in many places. It makes 
> code much less readable.

Read Index as offset form start. Then the index 0 makse some sense for 
the first element :)

>> But because 0-based is so
>> standardized in programming languages, 
> 
> Well, it is mainly C that has this "standardization". In Pascal this was 
> never a standard.
> 
>> it's just easier to follow the crowd
>> than fight them. :-)
> 
> In the first place it is. But if it would be available, the crowd may 
> change its mind.

IIRC indexes in VB were 1 based, didn't change much

Marc




More information about the fpc-pascal mailing list