What was the worst bug you've ever solved ?
Kirby: For a different definition of worst:I started a job recently at an ecommerce company.  There was a long-standing bug with the cart display in the upper right of the page always saying that the cart was empty.  People would report it all the time, and the quite smart lead programmer said it was something really complicated that he hadn't had time to investigate.But eventually, after I sort of knew my way around the code, and when I finished up all the tasks on my to-do list, he handed me that as a why-not-investigate sort of thing.  He didn't really have any idea, just that the previous long-gone coder had said it was complicated and in the depths of the way the front end code interacted with the order system.So, I reproduce it, and look at the template code.  These two lines, right next to each other:[% cart_summ = ourdb.cart_summary %]
[% IF cart_cumm.qty > 0 %]Note that the two variables don't match.  And this was broken on the site for _FOUR YEARS_.  And nobody looked because someone said he had and it was hard, and nobody had time for a hard problem.facepalm