scaling problems

Arnaud Delobelle arnodel at googlemail.com
Tue May 20 02:43:53 EDT 2008


James A. Donald <jamesd at echeque.com> writes:

> Ben Finney 

> The larger the program, the greater the likelihood of inadvertent name
> collisions creating rare and irreproducible interactions between
> different and supposedly independent parts of the program that each
> work fine on their own, and supposedly cannot possibly interact.
>
>> These errors are a small subset of possible errors. If writing a large
>> program, an automated testing suite is essential, and can catch far
>> more errors than the compiler can hope to catch. If you run a static
>> code analyser, you'll be notified of unused names and other simple
>> errors that are often caught by static-declaration compilers.
>
> That is handy, but the larger the program, the bigger the problem with
> names that are over used, rather than unused.

Fortunately for each file that you group functionality in (called a
'module'), Python creates a brand new namespace where it puts all the
names defined in that file.  That makes name collision unlikely,
provided that you don't write gigantic modules with plenty of globals
in them (which would be very unnatural in Python), and don't use from
mymodule import * too liberally.

Why not download a largish project in Python (a web framework for
instance, since you have a particular interest in this), study the
code and see if your concerns seem founded?

Arnaud

> --
>   ----------------------
> We have the right to defend ourselves and our property, because 
> of the kind of animals that we are. True law derives from this 
> right, not from the arbitrary power of the omnipotent state.

-- 
La propriete, c'est le vol !
                           - Pierre-Joseph Proudhon



More information about the Python-list mailing list