Comments on: Sometimes a little sleep is ok http://v1.ripper234.com/p/sometimes-a-little-sleep-is-ok/ Stuff Ron Gross Finds Interesting Sun, 02 Aug 2015 11:03:35 +0000 hourly 1 https://wordpress.org/?v=4.5.3 By: ripper234 http://v1.ripper234.com/p/sometimes-a-little-sleep-is-ok/comment-page-1/#comment-5255 Mon, 20 Feb 2012 19:12:36 +0000 http://v1.ripper234.com/?p=1648#comment-5255 @sun – Nice use case.

When you’re writing web crawlers, often you should be mindful of your resources, and since sleep() wastes a thread, you might want to look at other solutions like async-IO.

Still, I agree that if resources on your own crawler are not an issue, a quick-and-dirty sleep() on the crawler threads might be the best solution. Your comment takes me back a bit to my days of writing web crawlers at Delver 1.0. (We were a social search engine once)

]]>
By: sun http://v1.ripper234.com/p/sometimes-a-little-sleep-is-ok/comment-page-1/#comment-5254 Mon, 20 Feb 2012 16:51:48 +0000 http://v1.ripper234.com/?p=1648#comment-5254 Another exception to the rule: Part of a project I am working on crawls other sites and I send the 6 crawling threads to sleep after every page read to be polite to the crawled sites.

]]>
By: ripper234 http://v1.ripper234.com/p/sometimes-a-little-sleep-is-ok/comment-page-1/#comment-4845 Wed, 28 Dec 2011 10:37:13 +0000 http://v1.ripper234.com/?p=1648#comment-4845 @Hanin – Definitely! I always support practicality over religious “it should be this way because … the book says so” arguments.

]]>
By: M. A. Hanin http://v1.ripper234.com/p/sometimes-a-little-sleep-is-ok/comment-page-1/#comment-4844 Wed, 28 Dec 2011 10:25:32 +0000 http://v1.ripper234.com/?p=1648#comment-4844 One thing I’ve learned is that its OK to be religious about different aspects of software development, but being fanatic is usually counter-productive. Even in “AntiPatterns”, the author wisely specifies exceptions – cases where an AntiPattern might be acceptable. That includes Gotos, DoEvents/ProcessMessages, Waits/Sleeps… don’t judge a tool by its misuse.

]]>
By: ripper234 http://v1.ripper234.com/p/sometimes-a-little-sleep-is-ok/comment-page-1/#comment-4817 Sat, 24 Dec 2011 18:15:02 +0000 http://v1.ripper234.com/?p=1648#comment-4817 The whole page is supposed to close and move to the next one when the callback finishes.
No point in making just the “loading” icon fade out, if the entire page changes or closes.

Also, the loading gif is animated in the first place, adding a second dynamic effect like fading it out isn’t good in my subjective opinion.

I’m arguing that the delay does not deter from the user experience, but rather makes it smoother and more consistent.

From the comments here, and on Facebook and G+, it looks like I’m in the minority.

]]>
By: Avish http://v1.ripper234.com/p/sometimes-a-little-sleep-is-ok/comment-page-1/#comment-4810 Sat, 24 Dec 2011 10:25:38 +0000 http://v1.ripper234.com/?p=1648#comment-4810 So your solution for “it happens too fast and my long-loading icon is flickering” is to artificially make it slower? Wouldn’t it be better to just address the flickering, by e.g. showing the spinner only after a certain time or fading it in/out so it doesn’t flicker? You’re literally saying “dear user, this could’ve been instantaneous but for your convenience I’ve made it take longer so you could appreciate my nice spinner”. I don’t think that’s a very good idea.

]]>