-
-
Notifications
You must be signed in to change notification settings - Fork 314
Avoid the "undefined behavior" term #1204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You're right: "undefined behavior" doesn't necessarily mean "do whatever you want," but it also doesn't necessarily mean "don't do it," either. We use this in various ways.
In all "undefined" appears 10 times in the core spec (one is just in a release note) and doesn't appear in the validation spec. I think these usages are warranted. |
Related to json-schema-org/community#189 |
I'd like to suggest there's a few different terms that all proscribe the same behavior (that any behavior might be legal, with respect to the specification document), but with slightly different usages:
And like @gregsdennis says I think most of our usage seems to be roughly correct. The only usage that I think is baffling is json-schema-org/community#189 (maybe I should update the title there) |
@awwright I think the distinctions you made are relevant. Especially, it is key to define whether:
My experience is that, in the second case, specifications will eventually NOT RECOMMEND or FORBID those behavior. e.g see content with GET in the latest spec. |
@ioggstream I think most of our rationale for undefined behavior should be self-evident. Is there one in particular that's confusing? What do you mean by "NOT RECOMMEND or FORBID"? Putting the terms in capital lettering is generally done when the term is being used according to a specific definition, but NOT RECOMMEND and FORBID are not defined terms afaik. I don't think we should use RFC 2119 Key Words because that could over-constrain the specification (the behavior is already specified by JSON, which is a normative reference). |
imho "Explicit is better than implicit" :P
You are right: I meat "SHOULD NOT" or "MUST NOT" ;) Anyway, it's my 2¢ :) |
There's also a balance we have to strike with brevity. Maybe in some cases it's worth explaining the situation with a sentence though. Can you quote specific passages you find confusing? |
It's been four months without a clear response to the twice-asked question of specific concerns, so I'm closing this. Please do feel free to file new issues for each specific example of unclear wording / usage of "undefined behavior." |
I suggest
Note
While many implementer thing that "undefined behavior" means "do whatever you want", it actually means "don't do it". I suggest to avoid it and to explicitly state what is valid / in-scope for the specification and what doesn't.
This approach will make the document easier, and allows the reader to actually focus on the relevant parts.
The text was updated successfully, but these errors were encountered: