The size of a computer system is frequently assessed based upon the number of lines of computer code.
Source lines of code (SLOC) is a software metric used to measure the size of a computer program by counting the number of lines in the text of the program’s source code. SLOC is typically used to predict the amount of effort that will be required to develop a program, as well as to estimate programming productivity or maintainability once the software is produced.
Generally, larger systems are deemed to be more important and more rewarding.
Many useful comparisons involve only the order of magnitude of lines of code in a project. Software projects can vary between 1 to 100,000,000 or more lines of code.
Using lines of code to compare a 10,000 line project to a 100,000 line project is far more useful than when comparing a 20,000 line project with a 21,000 line project.
While it is debatable exactly how to measure lines of code, discrepancies of an order of magnitude can be clear indicators of software complexity or man hours.
However, there is an old adage: Its quality not quantity that counts.
SLOC measures are somewhat controversial, particularly in the way that they are sometimes misused.
Experiments have repeatedly confirmed that effort is highly correlated with SLOC, that is, programs with larger SLOC values take more time to develop.
Thus, SLOC can be very effective in estimating effort.
However, functionality is less well correlated with SLOC: skilled developers may be able to develop the same functionality with far less code, so one program with fewer SLOC may exhibit more functionality than another similar program.
In particular, SLOC is a poor productivity measure of individuals, since a developer can develop only a few lines and yet be far more productive in terms of functionality than a developer who ends up creating more lines (and generally spending more effort).
Good developers may merge multiple code modules into a single module, improving the system yet appearing to have negative productivity because they remove code.
Also, especially skilled developers tend to be assigned the most difficult tasks, and thus may sometimes appear less “productive” than other developers on a task by this measure.
Furthermore, inexperienced developers often resort to code duplication, which is highly discouraged as it is more bug-prone and costly to maintain, but it results in higher SLOC.
SLOC is particularly ineffective at comparing programs written in different languages unless adjustment factors are applied to normalize languages.
Various computer languages balance brevity and clarity in different ways; as an extreme example, most assembly languages would require hundreds of lines of code to perform the same task as a few characters in APL.
Unfortunately, the following graphic from Information is Beautiful clearly illustrates that many IT managers stubbornly cling to the [typically male] belief that size counts and studiously ignore the intrinsic truth that Bigger Isn’t Always Better.
Source: Information is beautiful