Tell Them You’re Still Alive

Every now and then, I am running an application, and I cannot tell whether it is still doing something useful, or simply deadlocked. I check my CPU stats, showing 100% load, which indicates the program might be in a deadlock state; to be more precise it might be livelocked. It might be really dead if my CPU is showing 0%. Should I kill it? Or should I leave it running for a while?

I think a good piece of software should always show a user it is still progressing.

So how, as a developer, do you decide for which cases you should show progress and in what way?

In general, I would say, running an application, it should never be executing a task for more than one minute without showing it is still progressing. That way you can easily tell when something might be wrong with the application: if it is running for more than one minute without showing progress.

The obvious way to show progress is by displaying the percentage of work done so far. However, you will need to know beforehand the size of the task. Progress bars can, and are generally used to visualize progress in this case. If a task’s size is unknown beforehand, it is all the more important to show progress; generally a moving element — like an hourglass, or the good old ASCII spinner — should do the trick.