Skip to content

Commit 25c4009

Browse files
committed
content(post): hyrmus law
1 parent 96ee5ef commit 25c4009

File tree

7 files changed

+234
-75
lines changed

7 files changed

+234
-75
lines changed

public/logs/movie/crash-2004.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Crash (2004)
2+
3+
- **Director:** Paul Haggis
4+
- **Rating:** 4/5
5+
- **Date:** 2026-02-05
6+
7+
Crash (2004) is a drama film directed by Paul Haggis that explores racial and social tensions in Los Angeles through the interweaving stories of strangers.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Eternal Sunshine of the Spotless Mind (2004)
2+
3+
- **Director:** Michel Gondry
4+
- **Rating:** 4/5
5+
- **Date:** 2026-02-05
6+
7+
Eternal Sunshine of the Spotless Mind (2004) is a romantic sci-fi drama directed by Michel Gondry. It follows an estranged couple who erase each other from their memories, only to rediscover their love.

public/logs/movie/movie.piml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
(logs)
2+
> (item)
3+
(category) Movie
4+
(date) 2026-02-05
5+
(link) https://www.imdb.com/title/tt0338013/
6+
(director) Michel Gondry
7+
(rating) 4
8+
(slug) eternal-sunshine-of-the-spotless-mind-2004
9+
(title) Eternal Sunshine of the Spotless Mind (2004)
10+
(description) Eternal Sunshine of the Spotless Mind (2004) is a romantic sci-fi drama directed by Michel Gondry. It follows an estranged couple who erase each other from their memories, only to rediscover their love.
11+
12+
> (item)
13+
(category) Movie
14+
(date) 2026-02-05
15+
(link) https://www.imdb.com/title/tt0375679/
16+
(director) Paul Haggis
17+
(rating) 4
18+
(slug) crash-2004
19+
(title) Crash (2004)
20+
(description) Crash (2004) is a drama film directed by Paul Haggis that explores racial and social tensions in Los Angeles through the interweaving stories of strangers.
21+
222
> (item)
323
(category) Movie
424
(date) 2026-01-30

public/posts/hyrums-law.txt

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
> **⚠️ Warning: Behavioral Changes Ahead**
2+
>
3+
> If you rely on the specific way this blog post is formatted to scrape it for your AI training data, I apologize in advance.
4+
> By reading this, you are effectively becoming an example of the very law I am about to explain.
5+
6+
# Hyrum's Law: Why Your Bug Fix Broke My Spacebar Heating Workflow
7+
8+
**Imagine you are a developer.**
9+
10+
You find a bug. It's a small one. The CPU usage of your app spikes when the user holds down the spacebar.
11+
It's inefficient. It's a waste of battery. It's clearly wrong.
12+
13+
So, you fix it. You optimize the code, reduce the CPU load, and push the update, feeling like a responsible engineer.
14+
15+
**Ten minutes later, you receive a bug report.**
16+
17+
> "My workflow is broken! I hold down the spacebar to heat up my laptop so my cat can sleep on it. PLEASE REVERT IMMEDIATELY."
18+
19+
This is the essence of **Hyrum's Law**.
20+
21+
---
22+
23+
## 1. The Law
24+
25+
Named after Hyrum Wright from Google, the law states:
26+
27+
> **"With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody."**
28+
29+
In simpler terms: **If it happens, someone relies on it.**
30+
31+
It doesn't matter if your documentation says "The order of items in this list is random."
32+
If your implementation *happens* to return them alphabetically 99% of the time, someone, somewhere, has written a script that breaks the day you actually make it random.
33+
34+
---
35+
36+
## 2. The Evidence: Real World "Features"
37+
38+
You might think the spacebar example (made famous by [XKCD 1172](https://xkcd.com/1172/)) is an exaggeration. It is not.
39+
Here are three real-world examples of Hyrum's Law in action that prove users will misuse anything.
40+
41+
### Case A: The "Load Bearing" Bug
42+
43+
I once worked on a system where a specific API endpoint would timeout exactly after 60 seconds if the database was busy.
44+
It was a flaw. We spent weeks optimizing the query to ensure it returned in under 2 seconds.
45+
46+
**The Result:** A partner integration crashed.
47+
**The Reason:** Their code didn't have a built-in sleep timer. They were *relying* on our API being slow to throttle their own requests.
48+
By fixing our performance, we DDOS'd their server.
49+
50+
### Case B: The Hash Map Sorting Lottery
51+
52+
In many programming languages, iterating over a Hash Map (or Dictionary) is technically unordered.
53+
However, in older versions of some languages, the iteration order often happened to be the insertion order.
54+
55+
Developers noticed this. "Oh, I put 'A' in first, so 'A' comes out first."
56+
They wrote code assuming this behavior.
57+
58+
Then, the language developers upgraded the hashing algorithm to be more secure and faster. Suddenly, 'B' came out before 'A'.
59+
Millions of unit tests across the globe failed instantly. The "contract" said unordered. The "reality" was ordered.
60+
Hyrum's Law won.
61+
62+
### Case C: The Excel Database
63+
64+
Excel is a spreadsheet. It is designed for formulas and finance.
65+
It is **not** a database. It is **not** a project management tool. It is **not** a rendering engine.
66+
67+
Tell that to the entire global financial system.
68+
If Microsoft decided to enforce "proper usage" of Excel and removed the ability to abuse cells as makeshift database tables, the world economy would likely collapse by Tuesday.
69+
70+
---
71+
72+
## 3. The Developer's Dilemma
73+
74+
Hyrum's Law creates a paradox for engineers.
75+
76+
We want to improve things. We want to refactor code, fix bugs, and optimize performance.
77+
But every change, no matter how "internal" or "safe," has the potential to break a user's workflow.
78+
79+
**So, what do we do?**
80+
81+
We have two choices:
82+
83+
1. **The Ossification Strategy:** Never change anything. Keep every bug, every quirk, every inefficient behavior forever because "someone might be using it." (See: Windows backwards compatibility).
84+
2. **The "Break It Early" Strategy:** Intentionally introduce randomness. If an API returns a list, *shuffle it* before returning it, even if you don't have to. Force users to respect the contract by making the implementation unreliable.
85+
86+
## Conclusion
87+
88+
The next time you fix a bug and someone complains, remember: **You didn't just change the code; you changed their reality.**
89+
90+
You are not just an engineer; you are the caretaker of a thousand invisible dependencies.
91+
And somewhere, right now, someone is probably holding down a spacebar, waiting for their laptop to warm up.
92+
93+
> **Lesson:** The only bug-free code is code with zero users.

public/posts/posts.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
[
2+
{
3+
"slug": "hyrums-law",
4+
"title": "Hyrum's Law: Why Your Bug Fix Broke My Spacebar Heating Workflow",
5+
"date": "2026-02-05",
6+
"updated": "2026-02-05",
7+
"description": "With a sufficient number of users, every bug becomes a feature. Exploring why you can't fix anything without breaking someone's weird workflow.",
8+
"tags": ["software-engineering", "hyrums-law", "xkcd", "philosophy", "bugs", "dev"],
9+
"category": "rant",
10+
"filename": "hyrums-law.txt",
11+
"authors": ["fezcode"],
12+
"image": "/images/defaults/visuals-2TS23o0-pUc-unsplash.jpg"
13+
},
214
{
315
"slug": "architecting-trust-preventing-insider-threats",
416
"title": "Architecting Trust: 5 Patterns to Prevent Insider Threats",

public/rss.xml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,28 @@
99
<link>https://fezcode.com</link>
1010
</image>
1111
<generator>RSS for Node</generator>
12-
<lastBuildDate>Sun, 01 Feb 2026 00:22:15 GMT</lastBuildDate>
12+
<lastBuildDate>Thu, 05 Feb 2026 01:56:02 GMT</lastBuildDate>
1313
<atom:link href="https://fezcode.com/rss.xml" rel="self" type="application/rss+xml"/>
14-
<pubDate>Sun, 01 Feb 2026 00:22:15 GMT</pubDate>
14+
<pubDate>Thu, 05 Feb 2026 01:56:02 GMT</pubDate>
1515
<copyright><![CDATA[2026 Ahmed Samil Bulbul]]></copyright>
1616
<language><![CDATA[en]]></language>
1717
<managingEditor><![CDATA[samil.bulbul@gmail.com (Ahmed Samil Bulbul)]]></managingEditor>
1818
<webMaster><![CDATA[samil.bulbul@gmail.com (Ahmed Samil Bulbul)]]></webMaster>
1919
<ttl>60</ttl>
20+
<item>
21+
<title><![CDATA[Hyrum's Law: Why Your Bug Fix Broke My Spacebar Heating Workflow]]></title>
22+
<description><![CDATA[[object Object]]]></description>
23+
<link>https://fezcode.com/blog/hyrums-law</link>
24+
<guid isPermaLink="false">https://fezcode.com/blog/hyrums-law</guid>
25+
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
26+
<pubDate>Thu, 05 Feb 2026 00:00:00 GMT</pubDate>
27+
<content:encoded><![CDATA[<blockquote>
28+
<p><strong>⚠️ Warning: Behavioral Changes Ahead</strong></p>
29+
<p>If you rely on the specific way this blog post is formatted to scrape it for your AI training data, I apologize in advance.
30+
By reading this, you are effectively becoming an example of the very law I am about to explain.</p>
31+
</blockquote>
32+
<p><a href="https://fezcode.com/blog/hyrums-law">Read more...</a></p>]]></content:encoded>
33+
</item>
2034
<item>
2135
<title><![CDATA[Architecting Trust: 5 Patterns to Prevent Insider Threats]]></title>
2236
<description><![CDATA[[object Object]]]></description>

0 commit comments

Comments
 (0)