public class FrankLoop() (programmer joke)

An area for laughter. We welcome intelligent and clean jokes.

Moderator: Edward

public class FrankLoop() (programmer joke)

Postby Don_HH2K » Thu 16 Feb, 2006 4:12 pm

A true story!

How do you create a loop without actually spawning a loop? Somebody in AP Java Programming managed to pull it off. (Bear with me -- this happened awhile ago and I can't remember the full code, though this was the specific line of code.)

Code: Select all
public class FrankLoop() {
FrootLoop * new FrankLoop();
}


For those that don't understand the code, this will just keep spawning more FrankLoop()s.

Simple, no? Frank called in Eric, the Java-programming wiz-kid, to figure out why his program kept stalling. Eric looked over the code a few times, and eventually found the randomly-inserted FrankLoop() class. His reaction was even funnier than the existence of the code:

Eric wrote:YOU'VE CREATED AN INFINITE LOOP! IT WILL JUST KEEP GOING AND GOING AND GOING UNTIL IT RUNS OUT OF MEMORY!... let's try running it on someone's Web server!
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 Donzilla/1.1PR1 (WML/1.3)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Return to Penguin

Who is online

Registered users: Google [Bot], James