Whenever a program needs to perform a long running process, it’s important that it supplies some sort of progress indicator, so the user knows that it’s running. Sometimes it’s a throbber, a progress bar, an hourglass, or the infamous spinning beachball of death.


Ready for Geocities…

Carol inherited this PHP code, which wants to use a series of dots (“….”)

/*snip */

$count = 0;

while ($task) {

    /* run the task */

    $count++;
    if ($count == 50) {
         $dots = ".";
         if ($dotCount == 2) {
            $dots = "..";
         }
         if ($dotCount == 3) {
            $dots = "...";
         }
         if ($dotCount == 4) {
            $dots = "....";
         }
         if ($dotCount == 5) {
            $dots = ".....";
         }
         if ($dotCount == 6) {
            $dots = "......";
         }
         $dotCount++;
         if ($dotCount >= 7) {
            $dotCount = 1;
         }
    }
}

/*snip */

Let’s wait and see if the original developer can come up with a better idea