DEV Community

Discussion on: What was the worst bug you've ever written?

Collapse
 
codemouse92 profile image
Jason C. McDonald

Many years ago, I tried to use some deeply nested-for loops in ActionScript 3.0 code I wrote to find the right combination of values in an XML template to match the hash of a given file. (The goal was to determine what exactly had changed in the file.)

About 20 minutes into waiting for it to finish, I decided to figure out how long it was going to take.

I determined mathematically it would finish on June 18, 2598 at 8:42 AM.

I learned two things that day:

1) One-way hashes are called that for a reason.

2) Deeply nested for loops are the work of the Devil anyway.

Collapse
 
blouzada profile image
Bruno Louzada

I discovered Insert with multiple rows, tried insert 250k lines each line a insert command in a remote database it will take 5 days hahaha. With one insert and 250k rows it took < 5 mins.

Collapse
 
ben profile image
Ben Halpern

Well how's the script coming along now? Any celebrations planned for 2598?

Collapse
 
codemouse92 profile image
Jason C. McDonald

I don't have that much patience, so I just aborted it instead. :P