3

I usually have some doubts when I have to use prepositions, and one of my most frequent ones is when I should use “in” and when I should use “on”.

For example:

Returns true if the profile is found in the list, false otherwise.

Is it OK to say “in”, or should I use “on” there? Is there any strict rule about using “in” or “on”?

4

“In” implies boundaries in two or more directions. With a list, especially in coding, it’s entirely appropriate to say “in the list” in reference to something within the start and end boundaries of the list.

“On” suggests a floor of some kind, that is to say a surface that provides a lower boundary. With so many lists made on paper, it will not sound strange to say “on a list” because the list can be thought of as existing on a surface.

Summary: In this case, it’s up to you! The former seems more context-appropriate if you ask me, but neither should offend anybody. You’re either being more literal (“in”) or more figurative (“on”).

  • Thanks! The "dimensional" approach definitely makes sense. – jmm Nov 28 '14 at 19:15
  • 1
    Good distinction. It's one thing to say "both are fine", but probably most native speakers actually use both in detectably different contexts. Not with absolute accuracy or consistency, but you're certainly more likely to be in a list that's not obviously bounded by a single surface that it's on (a sheet of paper, say). – FumbleFingers Nov 28 '14 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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