54

Long ago I worked for a contractor company who took over an asp.net site from another contractor company. The client said that everything ran slow and he had already updated the hardware per the 1st contractor. We checked the db calls and things ran fine; so I said "search the solution for "sleep"", it came back with Thread.Sleep(1) in several places with comments saying it was to allow the AJAX Spinner to show on the pages.
Turns out the client asked for the spinner but the hardware was so fast the 1st contractors added sleep so the client would see the spinner.

Comments
  • 8
    The funny thing is this is pretty common... At least what I've seen and heard from other developers
  • 1
    @nonserotonin But why is it common? Not to crap on using a spinner but why sleep a thread in a website so the UI can fire it?
  • 5
    @bkwilliams in my experience someone who pays the bills "pictured" the spinner so if the spinner doesn't show up its not "right"
  • 5
    been there, done that

    sometimes client request a spinner to be there inorder to show that something big is happening to the end user.
  • 2
    Like installing windows or mac?
    "Setting up userconfigurations" √
    "Conecting to internet" √
    "Preparing desktop" √
  • 1
    I thought a spinner means that something is loading..... why the heck should it be shown while everythng is loaded.
  • 1
    That is scary; I'm glad we talked the guy out of pausing the site, but he wanted a spinner but he didn't want to force it to show.
  • 1
    @bkwilliams Exactly what @plumbus and @DarKneT said. People are expecting something when they click. If it just automatically loads up with all the info the user thinks that something is left out or that the page is not so important. I've read some paper on this. I will try to find it and post it here. It's quite dumb but it actually makes sense if you think about it.
  • 0
    @nonserotonin ha ha ha ha, owkeey dowkeey
    Focus should be returned to the user requirements....
  • 2
    I had the same issue. the most annoying is a spinner that shows up for 300 ms resulting in shity animations. I came up with a workaround to show no spinner if the load time is under 800 ms. Works like a charm no spinners unless you are on slow connection.
  • 1
    Hm. I often hear ppl curse the spinners when walking the streets.. Or visiting the library.
    "ugh that stupid slow spinner.. Come on.. " :p
  • 0
    We have a product that enters an item into a queue and once it leaves the queue its done and can be processed. The issue is that it sometimes takes a couple seconds to enter the queue. So i literally have to use sleep because otherwise the exit condition checking for an absent queue would be met :/
Add Comment