Dimitri Maziuk schrieb: > That is the basic argument in favour of compile time error checking, > extended to runtime errors. I don't really care if it's the compiler > or runtime that tells the luser "your code is broken", as long as it > makes it clear it's *his* code that's broken, not mine.
You can make runtime errors point to the appropriate code. Just apply "programming by contract": explicitly state what preconditions a function is requiring of the caller, have it check the preconditions on entry (and, ideally, throw the execption in a way that the error is reported in the caller's code - not a complicated thing but would require changes in the exception machinery of most languages). Any errors past that point are either a too liberal precondition (i.e. a bug in the precondition - but documenting wrong preconditions is still a massive bug, even if it's "just" a documentation bug), or a bug in the function's code. Regards, Jo -- http://mail.python.org/mailman/listinfo/python-list