Python handles globals badly.
jonas at wielicki.name
Sat Sep 12 10:51:30 CEST 2015
-----BEGIN PGP SIGNED MESSAGE-----
On 08.09.2015 16:31, Ian Kelly wrote:
> On Tue, Sep 8, 2015 at 5:55 AM, Vladimir Ignatov
> <kmisoft at gmail.com> wrote:
>>> I had some experience programming in Lua and I'd say - that
>>> language is bad example to follow. Indexes start with 1 (I am
>>> not kidding)
>> What is so bad about that?
> It's different from the rest 99.9% of languages for no particular
> reason. It's not "different from the rest 99.9% of languages".
> There are many languages that use 1-based indexing, e.g. Matlab,
> Pascal, Fortran.
To be fair, that is not entirely true. In Pascal, there are three
cases (you can argue that this doesn’t improve anything):
(a) statically allocated arrays where the programmer chooses the
InBitData: array [1..4] of Integer = (128, 32, 16, 64);
(b) strings, which start at 1, as historically, the length of the
string was stored at position 0; pascal uses length-delimiting instead
(c) dynamically allocated arrays which always start at 0.
So let aside the historical cruft from Strings, Pascal uses zero-based
indexing unless told otherwise.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
More information about the Python-list