Nick Hodges should slap someone with his book and let him read the chapter about exception handling 10 times. ;)
Nick Hodges should slap someone with his book and let him read the chapter about exception handling 10 times. ;)
http://docwiki.embarcadero.com/CodeExamples/XE5/en/DirectoryOperations_(Delphi)
http://docwiki.embarcadero.com/CodeExamples/XE5/en/DirectoryOperations_(Delphi)
That is..... hideous. Exit calls? Really?
ReplyDeleteI wonder who PyBot is (:
ReplyDeletehttp://docwiki.embarcadero.com/CodeExamples/XE5/e/index.php?title=DirectoryOperations_(Delphi)&action=history
seriously, exit() seems to be used way too often for escapes from try..end; maybe if you could declare variables in at the beginning of a new lexical-scope ala C+/C99 and it was all tight in the try..end.
ReplyDeleteLOL. I guess Nick Hodges was bot commander some time ago :)
ReplyDeleteMaybe it is some strange optimization? I just unable to find rational explanation for these Exits.
ReplyDeleteActually the Exits are not the problem, its the except and catching all exceptions and saying 'Incorrect path'... Ya know, there can be other errors than an incorrect path.
ReplyDeleteThat is at least understandable but why Exits?
ReplyDeleteTrue, the exception will catch any error and the programmer decided to respond with only a single error-message. Exception-Handling seems to be the lazy programmer's honey-pot, personally I think the language feature is partially to blame.
ReplyDeleteThe point which many programmers seem not to understand is that exception handlers are to handle the exceptional cases, not the foreseeable errors. And when an exception handler is appropriate, the message should be clear, useful, and convey some meaning to others than simply the author of the code.
ReplyDeleteDamn good point Bill Meyer!
ReplyDeleteBill Meyer spot on
ReplyDelete