14

Possible Duplicate:
Which preposition in front of “line” — “on”, “in”, “at”?

Given a numbered list of lines of text (in my case an algorithm), should I use "in line" or "at line" to refer to the content of the line?

For example

the code at lines 5-10 loops over the elements of a list

or

the operation in line 10 sums two positive integers.

1

2 Answers 2

16

I think there are three usages here.

One can talk about a line of code as one entity, for example the "code at line ten".

One can talk about a fragment of code that spans many lines, for example "the code at (or between, or from .. to ..) lines 5-10".

Finally, one can talk about a fragment of code within a line, for example "the object instantiation with a null constructor, which is found in line ten".

6

If referring to a specific line, then "at" would indicate either a statement about the entire line, or possibly about the first element, while "in" would be about a subset of the line.

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