Using exceptions when designing an API

See the original posting on DZone Python

Many know the tradeoff of using exceptions while designing an application:

On one hand, using try-catch block nicely segregates between regular code and exception handling code
On the other hand, using exceptions has a definite performance cost for the JVM

Every time I’ve faced this quandary, I’ve ruled in favor of the former, because “premature optimization is evil”. However, this…