Tuesday, May 25, 2004

A 'loop' is block of code that executes and iterates. In other words, the code does what it is programmed to do, comes to the end of the block and returns to the top and executes again, this time with something changed in the code, a variable incremented, one value added to another value, something. The reason something has to change is because loops can't go on forever, they have to have some sort of termination criterion, and when that criteria is met, the the loop is broken and the program continues on.

So what happens if there is a loop that has a termination criterion that is never met? In that case, you have an infinite loop, one that keeps iterating on and on and doesn't stop.

Brent and I use this really powerful server called Mordor to do our research work on. In the process of our coding we make many mistakes. As we code, we test, and when we test and have made errors, that could result in (yay) an infinite loop.

This is how fast our computer is: in one second, the computer speeds through enough code to fill a file with 3 megabytes worth of TEXT! If you let the infinite loop go for more than a few seconds, you can't even open up the notepad file because it is so large.

0 Comments:

Post a Comment

<< Home