The study http://www.adaic.org/whyada/ada-vs-c/cada_art.html
compares the productivity of CeeLanguage
, with interesting conclusions.
Their findings from 8 years worth of data:
- Ada lines [...] produce about 70% fewer internal fixes, and produce almost 90% fewer bugs for the final customer.
- On a feature basis, for every dollar we spent on Ada features we spent $1.63 on C.
Some of the explanations offered:
- We see that Ada specification files are consistently more commented and have more white space. This effect [...] appears to result from the use of Ada specification files for "understanding" the programs; developers seem to add comments to specification files because since the subprogram prototypes have to stand alone without code, the readers can't fall back on reading code [...]. [C] developers tend to go right to the actual subprograms and read code.
[This seems more like a cultural difference, given that C header files play a similar role to Ada specification files.]
- Better LocalityOfError. [...] When code compiles, it has a higher probability of successfully executing. [...] An error is local in time if it is discovered very soon after it is created; an error is local in space if it is identified very close (at) the site where the error actually resides.
- The extra information provided to Ada tools by its users [...] allows the tools to do more for its users.
- [Ada encourages] better program design. [..] The effects are subtle but account for some of the more major "progressive design deterioration" that forms the substrate of many extra hours spent not just in debugging but in trying to comprehend old or foreign code.
There should be no doubt that in the abstract or from a "pure technical" point of view and from the point of view of the developer, Ada is a much better language than C. However Ada was at its turn ridiculed in the writings of EwDijkstra
(not that they would have better opinion of C) because of unneeded complexities and CreepingFeaturitis
in the language.
But all that it boils down in the end is that the distinction between "technical" and "commercial" is not quite as clear cut as we fantasize it to be. In any language or technology comparison, commercial advantages (marketshare, big money behind, etc.) will ultimately translate into commercial advantages. So it happened with C: it was there on the market sooner, developer got used to it, lots of portable libraries and the portable UnixOs
were centered around C. By comparison, Ada standard was one of the most complex standards to be approved so it took a long while for compiler writers to produce adequate Ada environments (that were also significantly more expensive, I gather). In the end for a lot of non-safety critical projects, choosing Ada will translate into technical difficulties because tons of libraries were already available in C but not in Ada. C proved just GoodEnough
technically, and economically it was an enormous success.
Ada programs can call C libraries.