Menu
Inheritance: When your problems become my problems.
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
20 days ago
44.8M 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
Where's The Love
Programming
149.4M views
8 days ago
Musk's week
Debugging
137.1K views
3 years ago
The Horseshoe Theory Of Gaming Hardware Opinions
Gamedev
702.2K views
12 months ago