When Writing Code Means You've Failed

I was chatting with a fellow developer yesterday, who recently adopted the very cool Busy Box ASP.NET progress indicator that I recommended:


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2005/04/when-writing-code-means-youve-failed.html

We’ve had similiar experience at work with processing boxes in .NET Web applications and it’s amazing how much happier the users are when they know something is happening rather than wondering if the little IE flag in the upper-right of the browser is waving.

Irsquo;ll go ahead and be the jerk who suggests that if your app needs a progress bar yoursquo;ve already failed.

Irsquo;m only half joking. Consider the waves that the Ajax approach (http://www.adaptivepath.com/publications/essays/archives/000385.php) has made. Before Ajax, lsquo;WWWrsquo; stood for lsquo;World Wide Wait.rsquo;

This is great Jeff! I have found multiple “Legos” for my applications off of your blog! Agree with the thoughts on modern programming. Half of being a good coder these is how well you can google to bring up little goodies like this.

Now consider an Ajax app that pulls a large amount of data back (or a small amount over a slow connection): how do I know anything is happening without a progress indicator?

I agree. One of the many, many problems with this type of heavy client-side browser based app. And consider error handling…

I introduced a progress bar in one of my applications and it takes probably 10 milliseconds, not 10 seconds. Basically put whenever I run it, it’s 100%. You don’t see the “progress” though it does actually calculate and progress through each “stage”.

It’s one of those things I thought was cool at the time but it doesn’t actually do anything special. It does let me know the action is complete though I take for granted that when I say “complete” it actually performs the action. I guess it’s better to have something than nothing but in the future I’ll try to test for that 10 second limit before doing a progress indicator. I tend to code what I think is cool more than what I think is useful though it does help me if not to give me that warm and fuzzy feeling.

Now consider an Ajax app that pulls a large amount of data back (or a small amount over a slow connection): how do I know anything is happening without a progress indicator?

“if your app needs a progress bar you’ve failed”.

how ridiculous can a statement be, half joking or not? i know of processes that would make all the world’s supercomputers working in tandem groan under the strain, so it’s senseless to decry something other than 100% responsiveness.

i know of processes that would make all
the world’s supercomputers working in
tandem groan under the strain, so it’s
senseless to decry something other than
100% responsiveness.

This is an exception that proves the rule. Really, most of us are building business applications, not scanning the skies for communiqus from distant galaxies. It takes effort to tune an app to minimize wait times on long-running operations. It takes even more effort to design a UI such that the user doesn’t have to wait at all.

Obviously there are situations where a wait can’t be avoided because (a) you can’t decompose a given operation into enough background work and (b) you can’t squeeze any more performance out of the back end. I just think that most of the time we think we need a progress bar it’s because we’ve failed to do all that can be done to obviate a progress bar in the first place.

Too cool, got a windows forms sample?


“The corporate software architect of the future may have a function more akin to a plumber or a bricklayer than to a developer,” said Barr in Seattle. “To keep his dignity intact, let’s call him an assembler of components.”

http://www.eweek.com/article2/0,1895,1925437,00.asp

1 Like

Nils
Progress bars will always be important especially in todays utube,facebook world where users upload larger and larger files or wait for files to download. Also (to come closer to your biz app scenario) comparison sites (e.g. insurance) have long waits for data to aggregate from several sources.
You don’t need to be scanning the cosmos for ET to set off a long running process.

The plural of lego is lego.

Sorry, this is normally the sort of pedantry up with which I shall not put, but for some weird reason, I find “legos” just so utterly horribly wrong and stupid sounding it bothers me enough to pipe up.