Hacker News new | ask | show | jobs
by shurcooL 4676 days ago
I think spinners are absolutely worthless on the internet, they tell me next to nothing. I could be looking at it for another second or it may keep going indefinitely. A progress bar, no matter how bad, can tell me there is progress being made.

The spinners are more suitable for local apps like games and operating systems. If I see a spinner in a game, I know it hasn't frozen and should eventually finish loading.

1 comments

A progress bar, no matter how bad, can tell me there is progress being made.

Except it can't, really, because browsers don't expose any kind of "percentage complete" information to javascript code. Partly that's because the browser doesn't always know; if the response uses chunked encoding (common for anything that's not a static file), the initial headers don't indicate the length of the response, so the browser doesn't know what percentage of the response it's got until it's got the whole thing.

Basically, from the HTTP protocol up the stack is designed in a way that makes it really hard to know how much longer it's going to be before a request is complete. It's designed that way for good reasons, but the unfortunate side effect is that progress bars that have any degree of meaning are generally not possible for non-static content.

That's why we have spinners. They provide the user with feedback that says "yes, I saw that you clicked that, and I'm doing something about it", which is crucial, but they don't depend on knowing how long it'll take to do whatever is being done. Most of the time that's fine if the request completes within 10 seconds. Any longer than that and additional feedback is probably necessary, maybe using setTimeout().

It doesn't have to be percentage, just seeing "x many bytes downloaded (out of unknown maximum)" increase is seeing progress. Seeing a spinner spin around may mean x is going up, or x is exactly where it was 30 seconds ago, but the spinner is made to always spin anyway.
That's not a progress bar though; the visual metaphor of a progress bar is a container/tank that goes from 0% 'full' to 100% 'full'.

What you described is a more general status indicator, bytes received, which I would display along with a transfer rate. That should not be shown as part of a progress bar because you don't know the percentage. However, I do agree that it's very useful information, and I always watch that kind of status indicator on FTP/SCP/torrent/copy+paste file transfers.

Unfortunately, browsers don't provide great feedback info to javascript even for that basic information about an ongoing request, if they provide any feedback at all. Usually you just get 'started' and then 'done'.