(Originally on OnceAndOnlyOnce)'
Is OAOO a self-violating principle? Isn't OnlyOnce? sufficient? Why have the extra Once in the name?
I don't think it is a violation: "Only Once" is a necessary, but not sufficient, condition for "Exactly Once". -- DaveWhipp
I agree with DaveWhipp - it should be renamed ExactlyOnce.
But why do we need to cover the case of less than once? If it is possible to use something less than once then don't use it -- AsimJalis
That's the YouArentGonnaNeedIt principle. I agree with DaveWhipp, this is standard mathematical phrasing. If repeating a word is not allowed, then all sentences become a list of pointers to a thesaurus. Applying OAOO to a too small text makes for difficult reading. -- BobF.
JohnHortonConway coined the word onnce for OnceAndOnlyOnce, similar to the use of iff for if and only if.
But "once" can mean "more than once". Take the perfectly valid sentence, "If it happened once, it could have happened again." Just as the surrounding context can tell you that an "if" really means "if and only if," so does the context tell you which sense of the word "once" is meant.
There's no paradox. Code may be speech, but it's not as expressive as human language. OAOO is a human term to describe a programming principle. Humans don't require the same precision in speech as code. As an example, when was the last time you said "exclusive or" in real conversation?
I said "xor" in a conversation (with a programmer friend of mine, but not about programming) a week ago, and I speak Hebrew! -- AmirLivne
I may be mis-remembering this but doesn't Latin have different words for or and xor. -- JamesKeogh
It's clear there is duplication. I think the name ExactlyOnce is more appropriate. -- DonWells
wow ... well stated, Don.
However, if we want to be very precise and literal, why not reduce it to "Once"? What added information does the adjective "Exactly" provide?
Let's not overlook the lyric aspect; "once and only once" is a nice example of headless iambic trimeter. It flows nicely off the tongue.
I think the real paradox here is that this subject is being covered more than once. :) -JJ
Precisely. Seems to me that we need LessRedundancy.
Applied to the words used to this point on this page:
I think the biggest problem is the usual trait of programmers taking everything too literally. There is a time and a place for mathematical, literal precision. "Always" and "everywhere" are not them.
The comment that "Once and only once" is more aesthetically and idiomatically pleasing than "exactly once" is probably on the mark.
Like IfAndOnlyIf would make more sense if it were IfAndAlsoIf? ie a iff b is the same as a if b and b if a. But the former is convention
No paradox at all: Surely it is OnceAndOnlyOnce in the same way it is IfAndOnlyIf (iff)
-- JohnArrizza?
(and since I posted this clause in this page and in OnceAndOnlyOnce as well, this wiki is not conformant to OnceAndOnlyOnce.)
I always thought that OnceAndOnlyOnce was supposed to be a paradox, that that was the joke.
JohnArrizza?'s (reduplicated) comment is very similar to Mike G. Burton's comment on the aforementioned page. In the spirit of this discussion I state this reply once. The debate over the redundant and apparently self-conflicted term OnceAndOnlyOnce centers around the inclusivenss of options other than "exactly once". Doubt exists only because the term borrows a concept from mathematics IfAndOnlyIf (IFF) without really saying that it does. That issue should be put to rest, and then we can rest easy.
To illustrate, let's look at the language that distinguishes ivory-tower mathematicians from the masses. In mathematics IF doesn't exclude other ways of getting the same answer, whereas IFF absolutely does. In simple terms, Math is the search for Universal Truths on a purely parallel machine using all allowed inputs.
where mathematical IF is like if-endif, and mathematical IFF is like if-then-else.Many conditions on IFs can lead to the same result without a paradox.
S1if X then Y=1 endif S2if W then Y=1 endifThe downside of IF is that you don't know how you got an answer of Y=1. But IFF is a complete statement of truth. No other condition leading to the same answer in the "then" part can exist, or else you have a paradox.
S1if X then Y=1 else Y=(anything but 1) endif S2if W then Y=1 endifS1 by itself is all you need to know that the machine saw input X when you have the result Y=1. But with both S1 and S2, what's the value of Y with input W? Remember, both statements run in parallel.
So, is it inclusive or exclusive? Does it work like IF or IFF? The name OnceAndOnlyOnce has a euphonious ring to it, so it's nice to keep, but we need a stronger definition directly stating that the mathematical concept IFF or onnce maps onto this name. Then all of this discussion can be refactored out as redundant, once and for all.
This is all cute, but as usual, NaturalLanguage rules. Once does not express the same idea as Exactly once, and in turn neither of these are exactly equivalent to OnceAndOnlyOnce.
So, no, there is no paradox here. = )
*Do it exactly once. *Then do it exactly twice. *Now do it exactly three times! Wait a second... I thought I said do it exactly once?!?
Captain Ramius: Re-verify our range to target... one ping only. Capt. Vasili Borodin: Captain, I - I - I just... Captain Ramius: Give me a ping, Vasili. One ping only, please. Capt. Vasili Borodin: Aye, Captain. -- from "The Hunt for Red October"
See also: UseMention