[Tutor] Exceptions vs. Status Codes

Alan Gauld alan.gauld at freenet.co.uk
Wed Dec 7 13:00:39 CET 2005


> not have an answer.  Is it a better practice to have a function raise
> an exception on error, so that the error can be caught; or return a
> status code indicating that the function was unsuccessful?

Exceptions are nearly always better.
For some of the reasons why, see my tutorial topic on Error Handling

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list