This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Exception Handling


On Saturday 12 June 2004 00:03, Andrew Haley wrote:
> [...]
> I don't know what the dynamic exceution ratio of try blocks to throw
> statements is, but I would guess at least 1000:1.  There must be a
> study somewhere, but I can't find it.

I don't have any hard numbers either, but my experience leads me to believe 
that exceptions are thrown far more often than most VM/compiler developers 
would like to think. Sometimes Sun's APIs are to blame (by forcing the 
programmer to use try-catch rather than if-then-else), sometimes we would say 
the programmer is just lazy or ignorant. When I was working at Acunia the CTO 
berated the assembled developers for using too many exceptions, proclaiming 
that "exceptions should be exceptional" : so far as I could tell they ignored 
him completely.

Maybe someone who knows where to put the printf()s should try measring the 
try/catch ratio of some big lump of real-world code, e.g. Eclipse?

-- 
Chris Gray                      /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi        http://www.kiffer.be/k/
chris.gray@kiffer.be                         +32 3 216 0369


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]