0

This is a question about best practice, not a specific language/ syntax question.

When requesting user confirmation, e.g. Y/N to either continue execution despite some risky condition or exit to fix said condition, is it preferable to use Y or N for continue?

Obviously, that will depend on the phrasing of the question. For example, in a script I'm working on right now, I check a certain directory for a certain type of file that ideally should not be there, although it is not catastrophic if it is. If I find any I warn the user and give them the option to either quit so they can delete them or continue execution anyway. I can get the user's input using at least two phrasings:

Option 1:

"There are some files that should be deleted. Do you want to delete them? Hit Y to quit so you can delete them, or N to continue execution."

Option 2:

"There are some files that should be deleted. Do you want to continue execution? Hit Y to continue, or N to quit so you can delete them."

I'm wondering which of the above options will reduce the likelihood that a frustrated or tired user who is not paying attention will opt to continue execution despite the risks.

I.e. if a user is going to somewhat randomly pick Y or N, and there is some known propensity of the "average user" to randomly pick one over the other, I'd like to make quitting the more likely option to be selected in such a case.

PS: I have no idea how to tag this question, and I don't see a "best practices" tag.

4
  • 2
    I would try and avoid those Y/N type of questions in any scenario where there is even the slightest chance they might lead to confusion. Yes==cancel, No==continue is a classic example of having turned things the wrong way around – Yes is a usually “positive”, where as “cancel” is the negative here, and vice versa with “No”/“continue”.
    – CBroe
    May 30, 2014 at 18:02
  • 2
    I’d rather go with something explicit, like c for continue, q for quit – that at least makes (/should make) the user think about what they actually want to happen, whereas Yes-or-No type questions often lead to confusion and collide with what the user expects to happen in a situation, resp. with what they instinctively assume should be the positive (Yes) or negative (No) outcome of the situation.
    – CBroe
    May 30, 2014 at 18:03
  • Thanks for the feedback so far. @CBroe: I went with the option you suggested in this case and made C and Q with a prompt that repeats itself if you enter anything else. I agree that Y/N is so generic that when ppl see it, their sub-conscious reaction is often along the lines of "I just started this script and now I'm being asked if I want to continue this script - Argh!", followed by their ingrained default selection, which I'd bet is usually Y not N.
    – SSilk
    May 30, 2014 at 18:35
  • 1
    Put a red box around it labeled "Danger zone". Jun 1, 2014 at 15:37

3 Answers 3

5

Don't use "Yes" and "No" for confirmation questions. In many cases, it works, but sometimes it breaks. Then, you're forced to deviate from the usual, making the case even more complicated.

Do not use "Cancel" for the same reason. That'll end up in the user needing to cancel a cancellation. Don't laugh, I've seen them.

I recommend to put the opposite actions on the buttons. And don't put negations in there - sorry: Do put positive, unnegated actions there. Humans are known to be really bad when it comes to negations.

So what about: "There are some files to delete. [Delete] [Keep]"?

0

Vendors to routinely use the word 'continue' in command prompts, with a [Y/n] to indicate the hopefully obvious options:

Continue? [Y/n]

Commonly the first letter is capitalized and indicates the expected or default outcome. Vendors typically accept 'y', 'yes', 'n' and 'no' in a case insensitive way.


In your case the user isn't continuing anything. However, you could abuse the above convention by doing the following:

Continue deleting unnecessary files? [Y/n]

I would expect users to delete the files with the above prompt. I did carefully choose the word 'abuse', though; I expect you to care about your users' experience and not your convenience as a software developer.

0

I like the way gkrellm does it. They go with the usual Y to continue, but explain the risk in the prompt.

Should we discombobulate your thingamajig? This is usually safe, but has been known to cause instability on systems with an AGP graphic card. Y/n:

I don't know about other users, but for me, this is enough to read before mindlessly hitting "Y". Note that I am doing this during a lengthy and boring OS reinstall, so it seems to work even under adverse conditions. You can also see if you can make the warning more attention catching through visual design.

You can also ask the user to enter a capital Y for risky decisions, normal y for non-risky ones. (This is assuming you have a keyboard prompt; your wording "hit Y" makes me think you may have one).

3
  • There are always clearer options than Y/N. virtualnobi's answer explains how.
    – edeverett
    Jun 2, 2014 at 15:30
  • "I am doing this during a lengthy and boring OS reinstall, so it seems to work even under adverse conditions" - if you are re(!)installing OSses, you're surely not representing the majority of computer users. Anything you feel as an "adverse condition" is a nightmare for the average guy and girl. Jan 2, 2015 at 11:04
  • @virtualnobi Agreed that I'm not representatives. Still, in many respects, I react like a normal user (e.g. preference for clear labeling) even if what constitutes "good enough" for me can differ. In this case, I hope that Ssilk's program is not a nightmare for his users, and that the solution which worked for me in a situation that is boring, but not hopelessly overwhelming for somebody with my skill level, will also work for a user in a situation which is different, but also not hopelessly overwhelming for him. If the user is already overwhelmed, other things have to be addressed first.
    – Rumi P.
    Jan 5, 2015 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.