in reply to Re^3: The behavior is [sic] undefined
in thread The behavior is [sic] undefined

And once you know what actually happens, it is no longer undefined; just unspecified.

Thanks, got that. I' still not sure about "behavior", but that might come from my German (and Spanish) background where "behavior := Verhalten" which is related (!) to "Verhältnis := relationship". I think "behavior" more in terms of "comportment", e.g "behave yourself!", "¡compórtate!", which is beyond mere mechanics.

Replies are listed 'Best First'.
Re^5: The behavior is [sic] undefined
by BrowserUk (Patriarch) on May 14, 2009 at 01:05 UTC

    Unfortunately, my language skills barely allow me to cope with my native tongue--my attempts at other langauges have mostly either been humorous or a disaster--so I cannot offer you its etymology.

    I googled for define:behaviour. The first definition listed is:

    behavior: the action or reaction of something (as a machine or substance) under specified circumstances;
    . "Well behaved handling" can be applied to cars, motorcycles, aircraft...

    Behaviour is also not confined to use with concrete things like machines and people; it's not uncommon in our industry to talk of "well behaved algorithms"; and chemists talk of "well behaved reactions".


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^5: The behavior is [sic] undefined
by John M. Dlugosz (Monsignor) on May 15, 2009 at 16:33 UTC
    So, perhaps you can propose some words to use. I'm for using less common words to give a formal meaning when the common words are already meaningful to the reader or may be used casually within the explanations.

    • Behavior, or what the spec is defining in the first place. This really has two depths to it. The running program is defined by its side effects and the order in which they occur. Within the program, language constructs have meaning based on what came before, so behavior can include setting up certain data structures and so on.
    • Sometimes the implementor can choose between a few reasonable alternatives, like using signed or unsigned logic, or the length of something.
    • The implementor must complete the specification here, and choose something that is well-behaved and repeatable and doesn't interfere with anything else. It's not wrong to do that, but the result is "implementation dependent".
    • It's really bad to do that, and doing so may cause the rest of the specification to no longer hold. That's "undefined behavior".
    • Containment and correction -- if "really bad" is defined in terms of the spec no longer holding, you can instead define other changes to the system, e.g. a variable is now something else, and then get back on the rails in terms of the specification holding under the modified state.