Thread-sleep Memes

Posts tagged with Thread-sleep

Nothing Is More Permanent Than A Temporary Fix

Nothing Is More Permanent Than A Temporary Fix
The "remove on Monday" comment from Black Friday 2019 is still there... and it's clearly not Monday anymore. What started as a quick hardcoded return value for the CEO's brother-in-law (nepotism at its finest) has now become production code that's survived multiple years. But wait, it gets better. The actual implementation below is a beautiful disaster: a 2-second sleep to prevent DDoS attacks (because that's definitely how you handle those), catching InterruptedException while ignoring it completely, and my personal favorite—the comment "DO NOT REMOVE THIS SLEEP" written in all caps like a desperate warning from a past developer who learned the hard way. The ticket reference 🎫#402-B suggests someone actually documented this madness. Somewhere in JIRA, there's probably a ticket from 2018 that says "temporary fix for payment gateway" that's been marked as "Won't Fix" for 6 years running. Fun fact: Thread.sleep() in production payment code is basically Russian roulette with your uptime SLA. But hey, if it works, don't touch it... right?

Choke Me Daddy Dev Version

Choke Me Daddy Dev Version
When your input validation finds a null value and decides the appropriate punishment is making the thread sleep for approximately 115 days. Nothing says "robust error handling" quite like passive-aggressively freezing your application because someone didn't fill out a form field. The comment "Punish user for null" is chef's kiss – like the developer is some kind of vengeful deity dispensing justice through Thread.Sleep(). Sure, you could throw an exception, log it, or display a helpful error message... but why not just commit application seppuku instead? Your users will definitely appreciate the 9,999,999 millisecond timeout while contemplating their sins of poor data entry.