Source lines of code

Lines of code ( LOC abbreviated or LoC, in English also " SLOC - Source Lines of Code") is a term used in information technology or the programming jargon. He comes from English and means something like " number of lines of code ".

The measurement of "Lines of Code" can be used as a software metrics for the size or the growth of a program.

This metric does not allow direct conclusions about the efficiency of a programmer, because the number of rows depends on diverse factors: chosen architecture, experience of the programmer chosen solution, source code formatting, programming language, etc. In addition, the 80-20 rule states 80% of the lines are written in 20 % of the time. Thus, the thorough testing of a program take a long time to complete, while the number of modified or supplemented program lines is small.

Types of calculation

In Lines of code, there are some common characteristics which are explained by giving the following example:

/ * How many lines are those? * / public void ausgabeEinsBisHundert () {      for (int i = 1; i < = 100; i ) {      System.out.print ( "" i); / / here the output of the numbers out of the loop    } } Lines of code ( LOC) Even Physical Lines of code called. Number of lines including blank lines and comments. In the example above 7 is often taken as representative of one of the other types of calculations. Source Lines of Code ( SLOC ) Number of lines of code without blank lines and comments. In the above example 5 Comment Lines of Code ( CLOC ) Number of comment lines, which is not defined, whether lines are included with code and comments. In the above example thus 1 or 2 Non- Comment Lines of Code ( NCLOC ) Even non -comment source lines ( NCSL ) or Effective Lines of Code ( ELOC ) called. Number of lines of code without blank lines and comments without header and footer. Headers and footers are especially the external opening and closing brackets, and ( at the class level ) Import / Include Statements and ( method-level ) method declarations. The above example has NCLOC method level 3, at the class level 5. Logical Lines of Code ( LLOC ) Also called Number of Statements ( NOS). Counts the number of instructions. For example, when used in COCOMO. In the above Example 2 In the C programming language, however, the instructions in for loops considered a unique statement. In C, the above example would therefore 4 LLOC. use

Most comparisons of programs on the LOC consider only the orders of magnitude of the number of lines of different projects. Computer programs may consist of only a few tens to hundreds of millions of lines of code. The scope of a program in lines of code does not necessarily allow conclusions about the complexity or functionality of the program, since the use of external frameworks and libraries, the programming language used and the formatting of the source code have great influence on the lines of code. In particular conclusions on the invested working time are mostly useful free.

Even when using Logical Lines of Code ( LLOC ) depends on understanding what is meant by a statement, and as the complexity of which is to judge by the programming language used. For example, in a comprehensive multiple screen pages assembler source code ultimately the same program be formulated, as in a few lines of high level language.

Depending on the programmer and the formatting guidelines used, the above example in the following, as seen programmatically completely equivalent code to be reformulated:

/ * How many lines are those? * / public void ausgabeEinsBisHundert () {    for (int i = 1; i < = 100; i ) System.out.print ( "" i); / / here the output of the numbers out of the loop } Now is the source of four physical lines of code (LOC ), three SLOC, depending on the calculation one to two Comment Lines of Code ( CLOC ), a Non- Comment Line of Code ( method level ) and continue two logical lines of code ( LLOC ).

Since the keywords to find the reduction of lines of code has reduced the readability, the complexity of the program has been increased, which, in turn, on productivity has a negative impact. Fewer lines of code can consequently cause higher expenses.

Examples

Here are some examples of the number of lines of code in various operating systems and application programs.

514037
de