Change the name of ArrayBoundsException in druntime

Sean Kelly sean at invisibleduck.org
Thu Oct 23 11:08:56 PDT 2008


Robert Fraser wrote:
> 
> Didn't see this discussion before I went off my tirade. I agree it's 
> recoverable and in a perfect world this would be so, but look through 
> any large codebase for how many catch(Exception) blocks there are. I'll 
> bet you that NONE of the general catch(Exception) blocks (except the 
> ones that print an error and exit the program) expect to see, or are 
> prepared for, an out of memory exception.

I'd argue that anyone who catches Exception, prints a message, and 
continues blindly is just asking for trouble.  But this seems to have 
become an ingrained practice anyway, so it's a fair point.  However, I'm 
not sure this is sufficient reason to relabel an out of memory condition 
as ostensibly unrecoverable.

> Asking programmers to think about out of memory errors is too much. 
> We're trained to assume computers have infinite memory and when they run 
> out, the system/runtime is supposed to do drastic things like crashing 
> our programs - not start introducing strange logic errors all over the 
> place because programmers didn't realize their catch(Exception) blocks 
> had to deal with more than "file doesn't exist"

Perhaps I'm simply getting old... when did memory use become irrelevant? 
  I grant that making an application exception safe is more difficult if 
out of memory conditions are considered recoverable, but I don't think 
it's tremendously more difficult.


Sean



More information about the Digitalmars-d mailing list