Learn English – “Only one” vs “Exactly one” referring item count

word-usage

We have a function and a piece of code that validates that one of specific parameters is present. Besides arguing whether we should state nullity or presence (e.g. Only one is not null vs Only one is present), we have a confusion about which word is more appropriate when it is used to state that there's only one conforms to a condition.

In other words, should we say Only one not null or Exactly one not null meaning that one parameter is present, but all others are absent?

Or maybe "Either is present" would be a perfect match? What do you think?

Best Answer

"Exactly one" clearly says that there must be one and not zero or two or any other number.

"Only one" is a little less explicit; it could mean that zero is also an acceptable value. Like if you said, "You can enter the contest only one time per day", I don't think most people would understand that to mean that you MUST enter every day. One is the upper limit.