Newbie : checking semantics

George Sakkis gsakkis at rutgers.edu
Sat May 7 22:34:48 EDT 2005


> What disappoints me is that pyton will happily accept and execute
this
> code :
>
> if ( aConditionThatIsFalse ):
>      AFunctionThatIsntDefined()
>
> print "Hello world"
>
> 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 !

You're absolutely right. Any real language should catch these types of
errors, just as it would verify that the program below is correct:


if (aCondition):
    AFunctionThatIsDefined()
.
.
.
.
def AFunctionThatIsDefined():
    return 0 / (0-0)


Moral: There are *many* more reasons for testing every execution path
than catching name or type errors.

George




More information about the Python-list mailing list