Interface and duck typing woes

Chris Angelico rosuav at gmail.com
Wed Aug 28 19:17:21 EDT 2013


On Thu, Aug 29, 2013 at 7:54 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> Depending on who the users will be, I might just not worry about it until an
> exception is raised. If you try to protect against everything that you might
> do wrong, you are on the road to madness, as the protection code might also
> be buggy. (Too much testing has the same problem ;-).

I'd go further.

Do you believe that you can write code to catch every bug you might
make? If so, you are naive and probably haven't spent much time
programming yet :) And if not, then you must acknowledge that bugs
WILL happen; therefore you will need to cope with them after the
event. So rather than trying to prevent them all, just improve your
means of coping, and you'll accomplish the same end with much less
trouble.

At this point I could go off into a lengthy discussion of philosophy
and original sin (not "original SYN", which is a different thing
altogether), but anyone who's ever written bug-handling code will
understand what I mean already :)

ChrisA



More information about the Python-list mailing list