Comment by tialaramex

1 year ago

If you accept that people are going to rely on things you didn't contract for by mistake then you're right back to Hyrum's Law. It's that easy.

Hyrum's Law isn't about what you should do, or how things should be, it's telling you an observable fact about our world that some people don't like. So no, the law isn't going to fix people's beliefs any more than Newton's Laws did for weird beliefs about motion.

I'd actually say the importance of documentation is better understood in the Rust community. Including, which is vital here, the importance of not relying on humans remembering to read all this text when you've got better options. Rust has documentation telling you that you're not promised whether or not some elements which compare equal are swapped when you [T]::sort_unstable. But it doesn't need to spend a lot of time warning you that that you shouldn't [T]::sort_unstable a slice of type T which doesn't even claim to have ordering, because the compiler rejects such nonsense anyway.

Indeed even the naming is an example. In C++ that function is just named sort. Because you know, an unstable sort is faster†. Will it sometimes surprise some poor noob because it's unstable? Sure, but apparently that's OK because if they had read and properly digested the documentation they would know it's an unstable sort. I suggest if the function were named better the user is much less likely to make this mistake before they even glance at the documentation.

† Typically

> Hyrum's Law isn't about what you should do, or how things should be, it's telling you an observable fact about our world

But it isn't.

Neither Hyrum, nor anybody else, has ever seen a system where "all observable behaviors" were depended on by somebody. And if they somehow had, they couldn't know that it hadn't mattered how clear the documentation had been.

There are two much weaker statements which I think are true:

- "No matter how carefully you document your contracts, it will happen from time to time that you leave something unstated and people reasonably guess wrongly what you intended."

- "No matter how carefully you document your contracts, from time to time some people will choose to rely on things you didn't promise, without caring about that."

As well as actually being true, these statements have the advantage of not falsely implying that you can't improve the situation by putting effort into documentation.

  • Surely your statements are just corollaries which are noticeable with fewer users ? Hyrum's Law is more succinct because of its prefix, "With a sufficient number of users".

    And I think we do see small systems where all observable behaviors are indeed depended upon, lots of trivial systems exhibit exactly this property, it's just it doesn't trigger the part of Hyrum's Law that apparently annoys you - "it does not matter what you promise in the contract" because if anybody did write a contract it would state the entire behavior, no surprises are possible.

    And that permits a valuable conclusion from Hyrum's law. It's better to design my interface so that it's so simple any fool will use it right, than to document all the weird sharp edges of my interface so that I can potentially win an "Um, actually" episode each time a fool cuts themselves on the sharp edges. That's not always possible but often in our industry it's apparent nobody was even trying.

  • Laws of nature are not prescriptive: they only predict what will happen. It is up to us to fend off consequences we don't want, by whatever means we can muster. The law means that calling out non-promises in the name is favored. But that is often not practical.