You know, I can press it.
Do not just click, I can click at the most inopportune moment. I can click it in the middle of copying a large file, right after the second stream starts.
Cancellation of this obligation
The next time you decide to add a cancel button, think of it as a commitment.
In my world, the cancel button has two meanings.
Stop something but break nothing.
Stop it, your mother!
Many times I came across the behavior of the cancel button, which is not obvious to the user. I usually start poking the cancel button whenever I see it, which scares my colleagues. I do this to find out that the cancel button is evil. And it is. Most of the cancel buttons did not work immediately or did not cancel global changes.
I also found that in most programs, instead of implementing the cancel button, the program has to be killed in memory in order to complete the half done work without the possibility of rollback.
Clarifying the situation
I will explain a little what button I mean. This is not the button that appears in the Ok / Cancel dialog. In most cases, this cancel button works, since it performs only the function of returning back, it does not cancel any process.
I'm talking about the cancel button, which completes the process. For example, the cancel button when installing a program or during an update from SVN.
You can call this element "button to cancel asynchronous operations."
But you need to enable the user to undo actions.
Well, all right, only do not deceive the user. There are things that, in principle, can not be undone.
When I'm on a plane, I can cancel my trip when the door to the salon is not yet closed. I can even cancel the trip when the plane rolls out onto the lane if I scream "I am going to rape everyone, and then blow up the plane!"
But I can not cancel the trip when the plane is in the air. If only I try ... It will be bad. Very bad.
So, what to do when I uninstall the program or the program changes the database and I see these nice little cancel buttons? Can I press them at any time?
Of course not! Naturally, some part of the process cannot be canceled, because the consequences will be fatal or it's too late for a rollback.
IMHO, if you really can not cancel something, do not show the cancel button, as if you can cancel. Just write: "Sorry, you can not cancel this process now."
I don't even want to know why I can't undo something. That is, what will make me happier, the knowledge that the Large Hadron Collider can destroy the Earth (if it’s canceled or the cancel button) is canceled or the cancel button is simply not active (or not at all). visible)?
')
Returning to the developers
I blame myself. I know that I have created a bunch of cancel buttons in the past that are painful and depressing.
But what can we do as developers?
First of all, we must carefully consider what will happen if the long process is interrupted. At each step of the process, it is necessary to provide for the possibility of cancellation, if this does not lead to deletion of data and freezing of the application. In any lengthy process, you need to determine which parts can be canceled, which parts there is no point in canceling.
As a developer, your task is to ensure that the process is canceled, and an immediate one. It is very important!
This is the behavior that users expect from the application and from the very meaning of the word “undo”. Of course, to do this, you need to do more work. You may have to think over the multithreading of your application for a long time. It will take a long time to think through the process of rollback. But, if you do not do this, your cancel button will look like a
story about a boy who shouted "Wolf!", But no one believed him .
If you are not ready to do this work, it is better not to show the cancel button to users, because, we argue, I will press it!