J
J de Boyne Pollard
m> As another side note, isn't it (reasonably) safe to assume that
m> if a memory allocation fails (because of insufficient resources)
m> the system is breathing its last breath anyway?
No. It's entirely wrongheaded. Running out of memory is a
potentially recoverable condition. And Parkinson's Law dictates that
systems will tend towards a state where they are operating at the
limits of resource utilitization. So users _want_ systems that can
recover from situations where machine resources happen to be
unavailable when requested.
m> As a side note, I have always disliked (and avoided) functions
m> that throw when an error occurs, I would rather they returned an
m> error and then I could throw if I wanted to. These types of
m> functions force the programmer to write code in a certain way,
m> which I think is against the nature of the language.
I suggest telling that to the people who think that exceptions _are_
the nature of the language. (-:
m> if a memory allocation fails (because of insufficient resources)
m> the system is breathing its last breath anyway?
No. It's entirely wrongheaded. Running out of memory is a
potentially recoverable condition. And Parkinson's Law dictates that
systems will tend towards a state where they are operating at the
limits of resource utilitization. So users _want_ systems that can
recover from situations where machine resources happen to be
unavailable when requested.
m> As a side note, I have always disliked (and avoided) functions
m> that throw when an error occurs, I would rather they returned an
m> error and then I could throw if I wanted to. These types of
m> functions force the programmer to write code in a certain way,
m> which I think is against the nature of the language.
I suggest telling that to the people who think that exceptions _are_
the nature of the language. (-: