DEV Community

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

Collapse
 
ihate1999 profile image
Abubakar Nur Khalil

I essentially wrote this somewhere in a Python codebase

while (some_cond):
   # Some code

Bug: some_cond was always initialized as 0 before the loop. So the code in the loop never ran.

Kept pulling my hair out till I was nearly bald before I realised it 😂