2

I'm a computer programmer trying to be perfect in my function and data type names. I have a function called "LookupAccountName" and want to create a name for the data structure with results of that function. So I came up with something like "LookupedAccount"

This sounds ugly to me. Google also doesn't find too much occurrences of this word, which is a sign that native language speakers don't use it.

What options do I have for naming something that was created as a result of a lookup? Is it "lookuped" or "looked up" or is there something else I'm missing?

closed as off-topic by ColleenV Apr 20 '18 at 14:18

  • This question does not appear to be about learning the English language within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 7
    Variable names in computer programs are not necessarily subject to the rules that natural language follows. But LookedUp is the word you want, not Lookuped. The "up" is detached from the verb stem. To look something up. I looked her number up when I got to town. The number was looked up. – Tᴚoɯɐuo Oct 16 '14 at 14:07
  • 1
    I would expect a function named "LookupAccountName" to return an object of type "AccountName". You might name an individual variable "lookedupAccount", but you wouldn't use that name for the data structure itself. – Hellion Oct 16 '14 at 16:24
  • @Hellion, makes sense, but unfortunately in Windows API LookupAccountName actually means "Lookup Account details by its Name", so it takes a name and returns account properties (SID and some other details that don't make a good abstraction together). That's why I chosen LookedUpAccount. – Anton Oct 16 '14 at 19:18
  • "Lookup" looks weird to me as a verb; the standard way to write it that I've seen is "look up" (a "lookup" is a kind of query or service, but the verb is "look up", just like you "log in" on a "login page"). I would honestly expect "LookupAccountName" to be the name of an account used to look things up: the name of a lookup account. The function name would be LookUpAccountName. – cpast Nov 27 '14 at 7:31
  • I'm voting to close this question as off-topic because "Naming, including naming programming variables/classes" is listed as explicitly off-topic in the help. – ColleenV Apr 20 '18 at 14:18
4

For a computer program, where consistency of naming is more important that smooth language, I'd say "LookedUpName", or maybe "LookupNameResult".

In common speech, I'd probably say, "found name". As in, "You said to look up the name. The name found was 'Sally Jones'."

1

If you mean lookup as synonymous to find, then use find.

Lookup already has a specific meaning in another context, as a Lookup table, which is a noun.

I would argue that lookup should never be at the start of a function name. The separable verb to look something up would mean that it would require camel-case, ie. lookUpAccountName.

I could imagine it as a noun however, e.g. accountNameLookup, which I would expect to be some sort of hash table.

lookedUpName seems redundant. foundName as a variable also seems potentially misleading in a programming context, as depending on your implementation, if it wasn't found, then it could contain null, false, empty or whatever.

Just use account and make sure that it is there, through whatever language constructs are available.

Not the answer you're looking for? Browse other questions tagged or ask your own question.