> From: Oleg Goldshmidt > I dislike errno-like global error codes - they are too easy to > overwrite and too easy to forget to check thoroughly (since they exist > sorta independently from the functions). > > I much prefer returning an error/success code from functions. Among > other things, I consider it useful that it strongly encourages, if not > strictly enforces, actually checking the bloody code after you call > the function.
Nope. I've seen tons of code where function return codes were not checked and then people just don't understand why things don't work (typical "undeveloper" phenomena - they keep assuming things just work, funny busterds :). Exceptions are the best way to force handling of errors. They can also convery lots of useful data (full objects) as well as use error hierarchy (e.g. a file-related exception type from which a "file open failed because the path contained an unreadable component" exception can be created). --Amos ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
