Menu
I test in production. Like a boss.
Home
Hot
Random
Search
Browse
AI
AWS
Agile
Algorithms
Android
Apple
Azure
Backend
Bash
C++
Cloud
All Categories
HTTP 418: I'm a teapot
The server identifies as a teapot now and is on a tea break, brb
HTTP 418: I'm a teapot
The server identifies as a teapot now and is on a tea break, brb
Dice-roll Memes
Posts tagged with Dice-roll
E Mudhra Relevant Xkcd
Programming
Debugging
Algorithms
7 hours ago
145.5K views
0 shares
The legendary XKCD comic that spawned a thousand code reviews. Someone wrote a function called getRandomNumber() that just returns 4. Forever. Always 4. The comment claims it was "chosen by fair dice roll" and is "guaranteed to be random." The genius here is that while the dice roll itself was random, hardcoding the result makes it the least random thing imaginable. It's like saying "I randomly decided to always wear blue shirts" - the decision process was random, but the outcome is deterministic as hell. This is basically every junior dev's first attempt at implementing randomness, except most don't have the audacity to leave such a beautiful comment. Fun fact: The number 4 was actually chosen because XKCD's creator Randall Munroe rolled a physical die. RFC 1149.5 specifies that 4 is the standard IEEE-vetted random number.
Today's picks
Employee Vs Freelancer Vs Founder Vs Vibe Coder
Programming
291.2M views
14 days ago
I like your funny words, magic man.
Programming
339.3K views
5 years ago
Deco Gear 49 Inch Curved Monitor, 5K2K Ultrawide WDQHD Screen 5120×1440, R1500, HDR400, 120Hz, 32:9 VA Panel, USB-C 65W PD, Adaptive Sync, PBP/PIP, KVM Switch, Built-in Speakers & Ergonomic Stand
Affiliate
$539.99