An empirical comparison of.pdf
文本预览下载声明
D
R
A
FT
An empirical comparison
of
C, C++, Java,
Perl, Python, Rexx, and Tcl
for a
search/string-processing program
Lutz Prechelt (prechelt@ira.uka.de)
Fakulta?t fu?r Informatik
Universita?t Karlsruhe
D-76128 Karlsruhe, Germany
+49/721/608-4068, Fax: +49/721/608-7343
http://wwwipd.ira.uka.de/EIR/
Technical Report 2000-!!!
February 29, 2000
Abstract
80 implementations of the same set of requirements, created by 74 different programmers in vari-
ous languages, are compared for several properties, such as run time, memory consumption, source
text length, comment density, program structure, reliability, and the amount of effort required for
writing them. The results indicate that, for the given programming problem, “scripting languages”
(Perl, Python, Rexx, Tcl) are more productive than conventional languages. In terms of run time
and memory consumption, they often turn out better than Java and not much worse than C or C++.
In general, the differences between languages tend to be smaller than the typical differences due to
different programmers within the same language.
D
R
A
FT
2 CONTENTS
Contents
1 On language comparisons 3
2 Origin of the programs 3
2.1 Non-script group: C, C++, Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Script group: Perl, Python, Rexx, Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Validity: Are these programs comparable? 4
3.1 Programmer capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 Work time reporting accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 Different task and different work conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.4 Handling a misunderstood requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.5 Other minor problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.6 Summary . . . . . . . . . . . . . . . . . . . . .
显示全部