Comparing productivity across programming languages can also give misleading impressions of programmer productivity. The more expressive the programming language, the lower the apparent productivity. This anomaly arises because all software development activities are considered together when computing the development time, but the LOC metric only applies to the programming process. Therefore, if one language requires more lines than another to implement the same functionality, productivity estimates will be anomalous.
For example, consider an embedded real-time system that might be coded in 5,000 lines of assembly code or 1,500 lines of C. The development time for the various phases is shown in Figure 1. The assembler programmer has a productivity of 714 lines/month and the high-level language programmer less than half of this, 300 lines/month. Yet the development costs for the system developed in C are lower and it is delivered earlier.
Analysis |
Design |
Coding |
Testing |
Documentation |
|||||
Assembly code |
3 weeks 3 weeks |
5 weeks 5 weeks |
8 weeks 4 weeks |
10 weeks 6 weeks |
2 weeks 2 weeks |
||||
Size |
Effort |
Productivity |
|||||||
Assembly code |
5000 lines |
28 weeks |
714 lines/month |