Skip to content
DevMeme
1346 of 7590
Testing Post #1515 · source on Telegram

A function that's only right on Tuesdays

Description

A screenshot of a chat conversation, likely Slack, between 'Brian Kendig' and another user whose name is redacted. The conversation begins with Brian asking how everyone is. The other user replies, 'Always wondering what day of the week it is.' Brian then shares a code snippet, written in a syntax resembling Apple's Swift language: 'func whatDayIsToday() -> String { return "Tuesday" }'. He follows up with, 'There, you can use that.' The other user points out the obvious flaw: 'it fails 6/7 of the time'. Brian's final, deadpan response is, 'I tried it several times this morning and it worked every time'. The humor lies in the classic developer trope of 'it works on my machine,' taken to a logical extreme. Brian's flawed testing (only on a Tuesday morning) and his refusal to acknowledge the function's fundamental design flaw is a perfect satire of developer tunnel vision and confirmation bias

Comments

7
Anonymous ★ Top Pick This is my new favorite date-time library. It has zero dependencies, is incredibly fast, and has a 100% success rate during the Sprint demo
  1. Anonymous ★ Top Pick

    This is my new favorite date-time library. It has zero dependencies, is incredibly fast, and has a 100% success rate during the Sprint demo

  2. Anonymous

    Hard-code whatDayIsToday() → “Tuesday” and you’ve eliminated flaky tests, DST edge cases, and 6⁄7 of your pager alerts - temporal certainty at the low, low cost of reality

  3. Anonymous

    This is the senior engineer's version of 'it works on my machine' - except now it's 'it works on my Tuesday.' The beautiful part is the implicit understanding that when you're deep enough in the trenches, every day genuinely does feel like Tuesday, making this technically a high-availability solution with 100% uptime in production (your mental state)

  4. Anonymous

    This is the software equivalent of a stopped clock being right twice a day, except Brian's function is only right once a week. The real tragedy isn't the 85.7% failure rate - it's that he tested it 'several times this morning' and never questioned why it kept returning the same value. Classic case of testing in production on a Tuesday, then shipping to users who inexplicably experience issues Monday through Monday. At least he's consistent with his 14.3% success rate, which is still better than most A/B test conversion rates

  5. Anonymous

    Temporal coupling at its finest: a date API with a 14.29% SLO - perfect if your monitoring only runs on Tuesdays

  6. Anonymous

    whatDayIsToday() -> "Tuesday" is demo-driven development: green during stand-up, SEV1 by Wednesday - this is why seniors mock time

  7. Anonymous

    Temporal CAP theorem mastery: perfect Consistency (Tuesday), total Availability, zero Partition tolerance beyond one day

Use J and K for navigation