Line Number - Line Numbers and Style

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, …) rather than (1, 2, 3, …). 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 subroutine would usually start at a line number sufficiently large to leave room for expansion of the main program (and previous subroutines). For example, subroutines might begin at lines 10000, 20000, 30000, etc.

Read more about this topic:  Line Number

Famous quotes containing the words line, numbers and/or style:

    The modern picture of The Artist began to form: The poor, but free spirit, plebeian but aspiring only to be classless, to cut himself forever free from the bonds of the greedy bourgeoisie, to be whatever the fat burghers feared most, to cross the line wherever they drew it, to look at the world in a way they couldn’t see, to be high, live low, stay young forever—in short, to be the bohemian.
    Tom Wolfe (b. 1931)

    All experience teaches that, whenever there is a great national establishment, employing large numbers of officials, the public must be reconciled to support many incompetent men; for such is the favoritism and nepotism always prevailing in the purlieus of these establishments, that some incompetent persons are always admitted, to the exclusion of many of the worthy.
    Herman Melville (1819–1891)

    As we approached the log house,... the projecting ends of the logs lapping over each other irregularly several feet at the corners gave it a very rich and picturesque look, far removed from the meanness of weather-boards. It was a very spacious, low building, about eighty feet long, with many large apartments ... a style of architecture not described by Vitruvius, I suspect, though possibly hinted at in the biography of Orpheus.
    Henry David Thoreau (1817–1862)