0

The context here is programming, so I'm not sure if anyone could understand.

I have a function that takes in two parameters. The first parameter is an enum while the second parameter is a list (of enum). What the function does is to search through the list to see if any of the enum matches the first enum parameter.

I'm trying to come up with appropriate names for the two parameters. Initially, I named the first parameter matchWith and the second parameter matchAgainst. Then I looked at it and felt that something is definitely wrong with these names.

I have read this, which would make the second parameter into candidates, but would still left me clueless how to name the first parameter.

What are some suitable choices for my case?

3
  • 1
    They are element (or item) and set perhaps. You check if "element" is a member of "set".
    – Kris
    Jun 8 '18 at 6:30
  • 4
    I'm voting to close this question because "Naming, including naming programming variables/classes" is out of scope for this site.
    – Lawrence
    Jun 8 '18 at 9:16
  • Python uses "needle" and "haystack". You always look for a needle in a haystack.
    – jimm101
    Jun 11 '18 at 9:24
2

Given that you search for matching items from a list, and having looked here and here, perhaps something like this:

itemFound = findItem (searchItem, resourceList)

0

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