Often when configuring settings, applications have both an "Apply" and an "Ok" button. Should the "Ok" button always perform the "Apply" before closing the window out? Are there pros and cons to doing this?

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.
If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers
3

Yes, the OK button should always "Apply". I don't see any cons, as there usually is a "abort/close window" button to revert the previous settings, in case you mis-configured something.

The optional "Apply" button should set the changes made in the current dialog without closing it. IMHO it is a convenience button, which is really useful in complex dialogs with many settings (e.g. Eclipse Preference Dialog).

At this point, Ok, apply, and cancel are the equivalent of household names. So many other applications have adopted the standard that apply means just apply, ok means apply and close, and cancel means cancel and close that making an attempt to change this or "be witty" in your application is more likely to just confuse, frustrate, or cause your users to make mistakes. The psychological impact of mistakes makes your users feel bad, and they associate this bad feeling with your application, not their lack of knowledge on how it works.

As an example of this concept, one of OpenOffice's successes with Calc came about because they lowered the barriers to entry for Excel users. When I first started using Calc, I was surprised that many of the same shortcut keys worked the same in Calc, and this made it easier for me as a user to commit to using Calc.

Had OpenOffice decided to completely redo their idea of how the shortcut keys worked, OpenOffice may never have gained a successful following.

If you apply this same concept to your application, you would really want to ask yourself what you have to gain by changing something that is not only tried and tested, but that also eliminates a potential and unnecessary learning curve in your application.

A co-worker once showed me one of those "you are losing all your work" dialogs he had coded. I pointed out that there is nothing "OK" about losing all my work. The next time he showed it to me, the dialog said "Oh well."
–
Wayne ConradMay 8 '12 at 1:48

1

The question isn't about "OK" on error dialogs but about "OK" and "Apply" on settings/property dialogs.
–
ChrisF♦May 8 '12 at 7:56

@ChrisF -- the point is overuse and misuse of the "OK" button has rendered it meaningless. "Apply"/"Cancel" is much better.
–
James AndersonMay 8 '12 at 10:24

@JamesAnderson - Apply and Cancel have no meaning for error dialogs which you appear to be talking about here.
–
ChrisF♦May 8 '12 at 10:26

The problem is one of standardization. No one familiar with computer applications takes the meaning of an "OK" button literally.
–
Cody GrayMay 8 '12 at 11:56