Comment by cpeterso
1 year ago
What are some fun or unusual examples of Hyrum’s Law that you’ve run into? Were you the user, inadvertently depending on some implementation detail? Or were users depending on your implementation’s details?
1 year ago
What are some fun or unusual examples of Hyrum’s Law that you’ve run into? Were you the user, inadvertently depending on some implementation detail? Or were users depending on your implementation’s details?
I reviewed a CL from Hyrum at Google where he was trying to remove a `set_timeout(float)` method in favor of `set_timeout(absl::Duration)` and changed the former to delegate to the latter. It turned out that there was some special handling of inf/nan in the legacy API, despite no mention in the documentation, and his CL broke a number of tests. It was amusing to experience Hyrum's law so directly :)
Love this! I was just reading the book and I came across this now, haha :)
I think Windows is the epitome of following Hyrum's Law decades before Hyrum's Law came into being :)
https://twitter.com/pwnallthethings/status/13632600649293620...
I guess the linux kernel still supprorting binaries from ages ago might be too.
> I guess the linux kernel still supprorting binaries from ages ago might be too.
Actually it's Linus making sure that kernel changes don't break old binaries from ages ago. And in fact there were many cases of undocumented behavior being relied on by apps, and Linus would send big rants about how you never break userspace, whether the behavior is documented or not.
Don't have any of them on hand right now, unfortunately.
This is probably the most famous one:
https://lkml.org/lkml/2012/12/23/75
1 reply →
At Google (long time off and on home of Hyrum), they migrated to swisstable from other hash maps. Unordered map iterates through the elements in insertion order. They explicitly couldn't support that without adding overhead to their new table so they randomized iteration order of the map
The migrations to the new table were fun because you would migrate some code and then find a test that assumed the order things were inserted into some seemingly distant protocol buffer array were in insertion order of the map
Usually the ordering was just a defect of the test, but it required actually digging in to be sure
IIRC There's a (CppCon?) talk about this rollout where Hyrum is in the audience so that he can heckle each time they describe a change which "obviously" can't break anybody because of course Hyrum's Law did cause that to break at Google when they did it.
Maybe somebody who remembers better can link it and/or correct my memory of exactly what's going on.
I believe it's this talk on swisstables from cppcon 2019:
https://youtu.be/JZE3_0qvrMg?t=1426
I joined a company once where some APIS were, for some reasons, returning strings instead of booleans (e.g. "false" instead of _false_). One of the system returned a typo for some edge cases, e.g. "ture" instead of "true". But instead of fixing this, other systems relied on the typo to be returned, so it was difficult to just fix the typo and move on.
Needless to say I didn't stick around.
I implemented a development-only feature which span up a thread and permanently held a lock on the database, effectively making the app useless until restarted.
A couple months later, I had a user thank me for it. I still don't know why
Let's just say "this HTTP endpoint expects its body to be JSON" and "we use a library that allows invalid JSON" (e.g. trailing commas) aren't exactly a good combination.
Code easily ends up depending on the specific library's quirks and config, regardless of what the actual contract said.