Programming Exceptions
One of the projects i’ve been slowly working on at home has gotten to a point where i’ve needed to understand the use of user generated exceptions. I have a basic understanding of how to deal with exceptions that are thrown by the Python interpreter, but i was unclear on when to define and use my own.
The following two articles, while both written for Java, have been very helpful in addressing my questions. “Exceptional practices” by Brian Goetz, and “Designing with Exceptions” by Bill Venners. They each have many links to other resources and articles, from basic “what are exceptions” questions to more advanced programme design issues. Good stuff if you are wondering when and how to use exceptions in your own software projects. Update here is a thread on c.l.p. about exceptions, which fills in the python-ness which is missing from the articles above (because they are about Java).
The c2 wiki has this to say about exceptions. Joel doesn’t like them but many people disagree with him.
This has, of course, led me off on a reading frenzy. So far, i’ve been sidetracked into reading about Design by contract and a py.test review, which is the third of three reviews of python agile testing tools. The other two reviews cover unittest and doctest.

Leave a comment