Can you list programming languages where array indexing does not begin at zero?

@nixCraft #Perl versions prior to 2019’s v5.30.0 let you change the base index value with the $[ special variable, mainly to placate #AWK migrations: https://perldoc.perl.org/variables/$%5B

(It had been deprecated since 2010’s v5.12.0)

$[ - Perldoc Browser

@mjgardner @nixCraft This is quite cool - why was it omitted?

@demiguise @nixCraft It had always been discouraged since #Perl 5.000’s release in 1994: https://github.com/Perl/perl5/blob/a0d0e21ea6ea90a22318550944fe6cb09ae10cda/pod/perlvar.pod#user-content-pod27

As to “why”—you’d have to ask either #LarryWall or #AndyDougherty.

perl5/pod/perlvar.pod at a0d0e21ea6ea90a22318550944fe6cb09ae10cda · Perl/perl5

🐪 The Perl programming language. Contribute to Perl/perl5 development by creating an account on GitHub.

GitHub

@mjgardner @demiguise @nixCraft I believe it was because it was so fragile. If you didn't scope it correctly, it could break all arrays.

Even if you did scope it correctly, it could break programmer's brains because if you didn't see that indexing started with zero, it would be very easy to mishandle arrays.