2011/3/9 Hans-Peter Diettrich <[email protected]>: > An exception down in some calculation doesn't give you any clue of what > exactly went wrong, only that *something* went wrong.
It can often be useful and remove a lot of if/else for cleanly exiting a bunch of nested loops and functions (and also save clock cycles and make the code much more compact and clearer) if you let it *automatically* unwind the the call stack (instead of writing code for this) whenever the exception occurs (of course only if you really know why your exceptions would occur). Many people recommend not using exceptions as control structures but IMHO exceptions *are* control structures and can (and should) be used as such (if appropriate). In some other languages (Python for example) this is even considered good programming style and recommended because it can make certain code much cleaner and easier to understand. -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
