Hacker News new | past | comments | ask | show | jobs | submit login

In a moment of pure debugging hell and hate, I put an alert with the text "WTF!" for a condition that should never occur. I could never get it to reproduce and, due to some distraction, I checked in the code with the alert still there.

I probably don't have to mention who got that alert while working one day. The president of the company, of course! Luckily for me it was not a customer-facing function & they found it funny.




I used to do the same thing. Then, the error that spelled "This should never happen!" started to pop up. A couple of years after the original code was written.

Now, older and wiser, I include full stack trace and my explicit assumptions on all errors - orders of magnitude easier to debug than cryptic error messages. Treat your future self kindly !


I put asserts in code for things that shouldn't happen. Sometimes I put them in debug mode only for friendlier behaviour.


I usually have error logging/reporting with full stack trace. This was a quick one-off that I definitely didn't mean to commit! One web app that I worked on years ago would save the entire session state of the user on error. We had a dev tool that would allow us to jump in with all of our session state all set exactly as this user on the exact spot where they had the error. It was pretty great for reproducing most errors except one pesky one that would show up in the logs randomly.

Finally, one day I accidentally triggered that annoying error by doing a specific sequence of things and then clicking the browser back button a few times, then doing another specific sequence. That was a day of celebration!


I have a habit of doing print("fuck")/raise Exception("fuck") ... Will not stop until I get caught - so far, so good.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: