TLDR Web Dev · OPINIONS & ADVICE

HASH ORDERING AND HYRUM'S LAW

eaftan.github.io5 min read

Summary from the TLDR Web Dev newsletter

Hyrum's Law states that any observable behavior in a system, even if undocumented, will be relied upon by some users. This has massive consequences, especially during large-scale migrations, as users might depend on seemingly insignificant details like hash iteration order. One example is the iteration order of hash tables in Java, which is technically unspecified but often remains stable for years. This can lead to users inadvertently writing code that depends on the order, causing problems during Java version upgrades.