in computing, a line number is a method used to specify a particular sequence of characters in a text file. the most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and incrementing by 1 for each successive line. in the c programming language the line number of a source code line is one greater than the number of new-line characters read or introduced up to that point. line numbers were a required element of syntax in some older programming languages such as gw-basic. the primary reason for this is that most operating systems at the time lacked interactive text editors; since the programmer's interface was usually limited to a line editor, line numbers provided a mechanism by which specific lines in the source code could be referenced for editing, and by which the programmer could insert a new line at a specific point. line numbers also provided a convenient means of distinguishing between code to be entered into the program and direct mode commands to be executed immediately when entered by the user (which do not have line numbers). largely due to the prevalence of interactive text editing in modern operating systems, line numbers are not a feature of most programming languages. ==line numbers and style== it was a matter of programming style, if not outright necessity, in these languages to leave gaps between successive line numbersâi.e., a programmer would use the sequence (10, 20, 30,&nbsp;â¦) rather than (1, 2, 3,&nbsp;â¦). this permitted the programmer to insert a line of code at a later time. for example, if a line of code between lines 20 and 30 was left out, the programmer might insert the forgotten line at line number 25. if no gaps were left in the numbering, the programmer would be required to renumber line 3 and all subsequent lines in order to insert the new line after line 2. of course, if the programmer needed to insert more than nine additional lines, renumbering would be required even with the sparser numbering. however, this renumbering would be limited to renumbering only 1 line per ten lines added; when the programmer finds he needs to add a line between 29 and 30, only line 30 would need to be renumbered and line 40 could be left unchanged. some basics had a renum command, which typically would go through the program (or a specified portion of it), reassigning line numbers in equal increments. it would also renumber all references to those line numbers so they would continue to work properly. in a large program containing subroutines, each subroutin
Source_code Text_editor_features