Newbie : checking semantics

Jeremy Bowers jerf at jerf.org
Sat May 7 18:49:40 EDT 2005


On Sat, 07 May 2005 15:05:20 -0700, LDD wrote:
> 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 !

Your unsubstantiated claim flies in the face of many man-years of
experience writing Python programs... and also has been discussed here so
many times it's hardly possible to count them. 

Summary: We know better, from experience. Quote dogma until you're blue in
the face, but nobody has managed to prove that large Python apps don't
exist, nor have they been able to show they were harder to write than
equivalent apps in more structured languages, which is also a tough sell
since they were easier.

To win this point, you need to produce evidence that doesn't exist.

Why not try opening your mind to the possibility that the dogma is wrong?

Points to ponder:

http://www.mindview.net/WebLog/log-0025
http://www.artima.com/weblogs/viewpost.jsp?thread=4639

The other point worth making is that if you want a language that you
already know, why not stick with it?

> Is there a way to force Python to check the definition of symbol ?

Look up "pychecker", but beyond that, no. It turns out such a thing is
meaningless in the sense you are used to (static analysis), because a
symbol may not have a referent until much later, and based on arbitrary
code. Python is late-binding, unlike C/C++/Java and friends.

I think that about summarizes the current state of the art on this point.



More information about the Python-list mailing list