C++ in KMDF

  • Thread starter J de Boyne Pollard
  • Start date
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. (-:
 
B

Ben Voigt [C++ MVP]

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. (-:

Exceptions are a feature of the language. The nature of the language is
that "C++ is a multi-paradigm language" (according to Stroustrup himself).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,270
Messages
2,571,353
Members
48,038
Latest member
HunterDela

Latest Threads

Top