Restored from previous forum. Originally posted by tinman.
Originally posted by Amiga5k
Wow Tinman, you must be the brainiac of the computer programming world if you think you can predict EVERY possible thing the user is going to try (intentionally or otherwise):
But it should have been logical to think it might be entered.
The part of my quote you highlighted isn't rocket science. You're working with strings, it's logical to think that you can get ASCII or Unicode, especially in Windows, especially on non-English systems. If you think that makes me some kind of brainiac then thats great.
Consider an application you write. The user can only realistically work within the confines of the gadgets, processes and things that your application provides. Yes, there will be a degree of system interaction which they can do to break your program, such as deleting DLLs, but you'll have thought about them and included checks for them.
So Ricardo's supposed to test his program on every version of Windows in the world (There are dozens, BTW) for every eventuality?
No and I didn't say he should.
Do you think you can produce a program of any appreciable length that can't be crashed?
What do you mean by appreciable length and what means can I use to get that length?
Code: Select all
End
DataSection
IncludeBinary "some_50_meg_file.bin"
EndDataSection
It's an appreciable length but I cannot say that it can't be crashed because I have no control over the code that PureBasic uses as startup, shutdown or the End keyword.
On different systems, using different languages then I may say yes (and yes, that is without exception handling).
You'd be the first ever, my friend! In Ricardo's case, an exception handler would have 'caught' the potential crash and allowed his program to report the error to the user, save information first, etc.
How can you know if the error would have been caught by the exception handler? How do you know ricardos program could have recovered? As plouf said, how do you police the exception handler?
As far as slowing the program down, depending on how the exception handling is done, sometimes extra code is inserted in the executable loop which will slow down the program. Ever notice that PB runs slower in Debug mode?
If you have done your own error checking then a lot of the PureBasic debug checking is not needed. My point there was that exception handling should not necessarily be slower than normal error checking, because you would be performing the same checks at each stage.
I think you're confusing error checking with exception handling. They're not the same thing. Error checking is something we should all be doing (i.e. Check to see if a file exists before you try to load it, etc). Exception handling is the next step up from that.
So what is exception handling other than a different means of reporting a problem that would normally be found by error checking? What is "the next step up"? If I am misunderstanding it then please explain why and how exceptions are so much better than error checking.
(Edit: fixed missing /quote which mangled the message)
--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)