i would rather check if it returned 0 or not, throw has to much power of the application for me.
Printable View
i would rather check if it returned 0 or not, throw has to much power of the application for me.
Correct... I totally agree. In fact, I considered this case in my post as well when I said the following in the suggestions part:Quote:
Originally Posted by SuperKoko
Quote:
Originally Posted by me
No. You are not incorrect. You are on right track! In fact, now just leave new failure away and think about any kind of exception. That is what you actually do for any other exception. Then why should new be given special treatment? Yeah, I agree they are all specific exceptional cases but still you have to handle them as far as you can and take remedial action specific to that exception, if you can. Otherwise - why would there be a need to write anything else except catch(...)?Quote:
Originally Posted by miteshpandey
Again, I put stress on this that the ability to recover is important if you are planning to put a catch block! How you are planning to recover depends on the programmer and the specifications that have been laid down in the design phase! Good examples are provided in SuperKoko's post above.
Regards.
Mitsukai, this does not make sense? What are you trying to say? Please be explicit while explaining things. The way you have written your post - its too confusing and in fact does not make sense.Quote:
Originally Posted by Mitsukai
If you are suggesting not use exception handling and using the historical ways of catching errors then I guess you must go ahead with reading the following FAQs for a start.
Exception handling FAQs
It has been unanimously decided on Codeguru that people use exception handling and hence you should too... if you don't agree do a search for exception handling on this forum and come back with the arguments. We would like to settle this forever! ;) :D