Newbie : checking semantics

Mike Meyer mwm at mired.org
Sat May 7 19:14:43 EDT 2005


"LDD" <loicderoyand at yahoo.fr> writes:

> I am new to python and was very enthustic about its possibilities when
> I discover that python is really what it is : just a scripting
> language.

That "just" covers a *very* big application space. So-called scripting
languages are being used in an ever-widening variety of ways.

> The fact that python doesn't check if the symbol
> AFunctionThatIsntDefined is defined, is really bad when you develop big
> pieces of code. You will never be sure that your code is free of this
> kind of dummy errors and testing every possible execution paths is
> nightmarish !

Testing every possible execution path may be nighmarish, but it's a
*requirement* for writing robust software. This is true whether
undefined variables are caught at compile time, execution time, or
later(*). You're never sure your code is free of bugs no matter what
you do, but adequate testing can help eliminate most of the dummy
ones. Failure to do that testing will ensure the presence of dummy
bugs in the code if you're developing a big piece of code, no matter
when they are detected.

Personally, I'm neutral on this issue. Clearly, declaring variables
saves time by catching such typos early. Equally clearly, not
declaring the variables saves time in that you don't have to enter the
declarations. While most RAD languages don't use variable
declarations, there are a number of factors that contribute to them
being faster than conventional languages, so the individual
contribution of this particular factor is unclear.

   <mike

*) There are languages out there that quietly plug in a default value
when you reference an unassigned variable. That means the bug doesn't
show up until you start checking output values, at which point you
find garbage. Adequate testing will uncover these bugs, but finding
the actual bug is a PITA.

-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list