Crash or return forbidden value?

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

CChris posed the question. I always have a tough time with this one. I can give
a few examples:

1. Open a file that does not exist. Well, the user may wish to try a different
file. Error code.

2. Connect to a database server fails. Error code, as you may have given
incorrect login credentials by user input and want to prompt the user for the
username/password again.

3. Requesting an out of bounds index for a given sequence. Crash. This tends to
be a programmers fault, not a users fault. The methods find_from, rfind_from,
etc... do this.

Now, translate that into a set of rules? Hm. Any thoughts? There seems to be
some theme going on of "testing the waters" vs. "do this just as I say", but I'm
not sure.

This is a good topic, thanks Chris for posing the question.

--
Jeremy Cowgar
http://jeremy.cowgar.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu