O'Reilly logo

Sams Teach Yourself Ruby in 21 Days by Mark Slagell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to Control Your Children

One rather entertaining use for a child process is to convince the human user that something productive is happening during a long calculation. When generating large Fibonacci numbers using our old inefficient recursive function, it might be comforting to see a little spinning bar at the text cursor position until the answer comes back.

Mind you, our “progress spinner” isn't a real indication of progress. It's just eye candy, a little psychological trick. If the calculation somehow got stuck in an infinite loop, the spinner would keep spinning, giving false assurance that all was right with the world. (Think of it like the animation Windows shows when copying files on the desktop, or like that infamous “your call ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required