Representative Line: An Equal Crunch

This post was originally published on this site

The Daily WTF

Rina works in an environment which tends to favor crunch. It’s a bit of a feast or famine situation, where they’ll coast for months on a pretty standard 9-5 schedule, and then bam, suddenly it’s 18 hours days.

No one particularly likes those periods, and code quality takes a nosedive. Co-worker Rusty, though, starts making utterly bizarre decisions when stressed, which is how Rina found this line while doing a code review:

int count = stackRepository.getQueryCount(queryPredicate); if(count > 0 && count < 2) { stackEngine.process(); }

“Um… what exactly are you doing with this?” Rina asked.

“Oh, yeah, well, we shouldn’t call the process method unless the count is exactly equal to one,” Rusty replied.

“Equal to one,” Rina repeated, slowly.

Rusty facepalmed. “Crap. You’re not gonna tell anyone about this, are you?”

“Your secret’s safe with me,” Rina said.

That line got caught before going too much

To read the full article click on the 'post' link at the top.