[Tutor] when to use exceptions

Andrei Kulakov ak@silmarill.org
Fri, 19 Jul 2002 01:28:09 -0400


On Thu, Jul 18, 2002 at 11:28:25AM -0400, Erik Price wrote:
> Where do you draw the line of when to use an exception and when not to 
> use an exception?  It seems that you could go on trying to catch 
> exceptions for every conceiveable problem... but you would spend all of 
> your time writing exception-catching code, right?

Not really, I don't think so.. Of course, in the early stages you
shouldn't do too much of that, but later on you write exception
handling for anything that could go wrong. Not enough space on a
partition, wrong user input, etc. Of course it may be handled without
exceptions, i.e. if it's user input testing you may have an infinite
loops that only breaks when user enters a valid answer. 

> 
> I'm asking in a theoretical sense, I don't have specific code that I'm 
> curious about.
> 
> Thanks for your thoughts,
> 
> 
> Erik
> 
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org