If I want to say that the source code contains some xyz text which one is right?

xyz is in the source code


xyz is on the source code
  • 1
    @CopperKettle - That's the right answer, but the wrong reason. Remember, “on” has several usages that have nothing to do with being on top of something. For example: On a cold day in February, on a whim, she wanted to be on the radio, so she called the station to talk about her time on the jury. She was on hold for a long time, but she still had a smile on her face. To name a few more, there's also "The drinks are on me!" – plus on target, on television, on camera, and so on.
    – J.R.
    Feb 6, 2015 at 11:22

1 Answer 1


I'd suggest that, when the exact location of the code is unknown or immaterial, "xyz is in the source code" is correct, but "xyz is on line 1348 of the source code" would be used for the more defined location.

  • So that also means "xyz is in the file xpto.c"? and also "xyz is on the line 1348 of the file xpto.c"? Feb 6, 2015 at 0:31
  • 1
    Yes, it also works that way with files. Feb 6, 2015 at 2:15
  • 1
    On line 1348. Not the line.... Generally, the code contains xyz may be a better style. It's more concise. But the best style choice will depend on how the sentence fits into the text, what might want emphasis, etc. The words "indefinite" and "case" are unclear in the above answer, and should probably be avoided because they are both grammar terms. Feb 6, 2015 at 3:36
  • @JimReynolds - Fair enough. Done. Feb 6, 2015 at 16:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .