Re: Try/Catch

new topic     » goto parent     » topic index » view thread      » older message » newer message

I'd like any I/O routine to return at least a Boolean value for success/fail, without triggering a fatal error. examples:
ok = puts(fn, "...")
ok = seek(fn, 256)
ok = close(fn)
etc.

It's more code to write, but it's essential. This way I can deal with I/O operations and access to databases immediately. Any user I/O routine must also return this value. This is how DOS I/O functions actually work (except the "critical error" and the Ctrl+C that should have been 'a bit' more friendly in DOS).

Division-by-zero and out-of-bound are up to the programmer to test - as if..then condition and any other part of the code.

Readable, modular and simple code works. Hardware, system and viruses problems are always there to crash or freeze the program anyway.

Last, there is no error handler that can replace a good, simple and maintainable code. Sadly, even professionals are tending to write messy, inconsistent, and undocumented code.
I don't see why an error handler should be a substitute for good coding.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu