lines of code


Also found in: Dictionary, Thesaurus, Medical, Legal, Financial, Acronyms.

lines of code

(programming, unit)
(LOC) A common measure of the size or progress of a programming project. For example, one can describe a completed project as consisting of 100,000 LOC; or one can characterise a week's progress as 5000 LOC.

Using LOC as a metric of progress encourages programmers to reinvent the wheel or split their code into lots of short lines.

lines of code

The statements and instructions that a programmer writes when creating a program. One line of this "source code" may generate one machine instruction or several depending on the programming language. A line of code in assembly language is typically turned into one machine instruction. In a high-level language such as C++ or Java, one line of code may generate a series of assembly language instructions, resulting in multiple machine instructions.

Lines of Code Are Not the Same
One line of code in any language may call for the inclusion of a subroutine that can be of any size, so while used to measure the overall complexity of a program, the line of code metric is not absolute. Comparisons can also be misleading if the programs are not written in the same language. For example, 20 lines of code in Visual Basic might require 200 lines of code in assembly language.

In addition, a measurement in lines of code says nothing about the quality of the code. A thousand lines of code written by one programmer can be equal to three thousand lines by another. See KLOC.
References in periodicals archive ?
Understanding developer and manager perceptions of function points and source lines of code.
As commercial software is developed, it typically contains 20 to 30 bugs for every thousand lines of code, according to Carnegie Mellon University's CyLab Sustainable Computing Consortium.
SCO said that IBM/Sequent had contributed 148 lines of code relating to NUMA (non-uniform memory architecture) and RCU (remove copy update) from Dynix into the Linux 2.
SLOC Report: Provides a graphical report of the total lines of code in a file, project, or solution.