3 ms·
Interesting things happen around this "undocumented" cases. For example, imagine you expose a "map" API and you explicitly don't mention it's a hash map or som
by ithkuil 6y ago
Interesting things happen around this "undocumented" cases.
For example, imagine you expose a "map" API and you explicitly don't mention it's a hash map or some tree. You also don't claim the the iterator will be in order, but you fail to document that you explicitly don't promise any order at all.
Some users will not read the documentation and say "wait a minute, it doesn't claim whether any ordering is guaranteed nor it claims the contrary, hence I must assume it's undefined behaviour thus I can't rely on any ordering".
Instead some users will look at the behaviour and assume the documentation just forgot to mention that aspect (and if the implementation indeed iterates the map in order they'll just assume that's what the documentation should have written).
After all, just as code, documentation can have bugs and will be amended in subsequent releases.
Now, you finally realize that you forgot to say "the iteration order is undefined" and make a new release with that documentation fix. The question is: would you consider this a major "breaking" change or a minor point release?