4

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

xyz is in the source code

or

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 '15 at 11:22
5

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.

| improve this answer | |
  • So that also means "xyz is in the file xpto.c"? and also "xyz is on the line 1348 of the file xpto.c"? – user1894919 Feb 6 '15 at 0:31
  • 1
    Yes, it also works that way with files. – Paul Senzee Feb 6 '15 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. – Jim Reynolds Feb 6 '15 at 3:36
  • @JimReynolds - Fair enough. Done. – WhatRoughBeast Feb 6 '15 at 16:30

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.