Source lines of code: Difference between revisions

Content deleted Content added
See also: Removed link that redirects to another page already in the list.
m Usage of SLOC measures: replaced some sensational terms with more scientific lingo
Line 45:
==Usage of SLOC measures==
{{weasel words|date=September 2013}}
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{{Citation needed|date=July 2009}}, 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,Counting SLOC is a pooras productivity measure ofhas its individualscaveats, 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 [[Duplicate code|code duplication]], which is highly discouraged as it is more bug-prone and costly to maintain, but it results in higher SLOC.
 
SLOC iscounting particularlyexhibits ineffectivefurther accuracy issues at comparing programs written in different languages unless adjustment factors are applied to normalize languages. Various [[computer language]]s balance brevity and clarity in different ways; as an extreme example, most [[assembly language]]s would require hundreds of lines of code to perform the same task as a few characters in [[APL programming language|APL]]. The following example shows a comparison of a [[Hello world program|"hello world" program]] written in [[C (programming language)|C]], and the same program written in [[COBOL]] - a language known for being particularly verbose.
 
{| class="wikitable" style="margin: 1em auto 1em auto"