Synonyms and antonyms for "lacking" or "missing" when something is mandatory

I am searching for the correct term usage in my Java code, although you don't need to know anything about programming to answer my question.

  • My "something" can be "required" (mandatory) or not (optional).
  • If it's required, then I want a term that indicates if it's missing or not
  • If it's not required, then it obviously cannot be "missing"

I know the terms I stated are "correct" but I'd like to know other synonyms or even antonym that would express that logic better.

I thought of "lacking", "absent", or "missing" or the antonyms "filled", "exists", or something like this.

I know the semantics are about the same, but I'm sure there's a better way to describe it!


Solution 1:

I would say your "something" is required or optional. If it's missing, then it is Undefined, if it's not missing, then it's Defined. (Those terms make more sense in the context of code than outside that context.) The container of your "something" can be Complete or Incomplete. Although Partial might be a better way to say incomplete.

Solution 2:

There are a whole bunch of possible words, but your "mandatory" item is only conditionally required, so any state/property name that makes it seem more mandatory than it really is is going to cause the next developer down the road some problems. If I were a maintenance programmer and saw an object or method name that had big flashing warning lights attached to it, I'd spend a lot of time looking for the place where it actually is required before I gave up. (And if it wasn't actually required anywhere and caused me to waste a lot of time, I just might submit the code to The Daily WTF to blow off steam.)

I'd stick to "clichés" like isEmpty(), isSet() or isNull() for the property or method name; whether or not the object (or variable) is mandatory should be evident in the code:

if (condition1 && !occasionallyMandatoryObject.isSet())
{
   // trigger error condition
}