Call for Programs: the "phonecode" benchmark

Tim Peters tim_one at email.msn.com
Wed Nov 24 15:18:23 EST 1999


[Lutz Prechelt]
>  - Out of the following set of scripting languages:
>      Perl, Python, Rexx, Tcl
>    do you prefer one over the others?

Yes.

>  - Do you think one is inherently better than the others?

Yes -- but which one depends on what you're doing <0.5 wink>.  Suppose the
task is this:  next Tuesday, you will be assigned a problem to solve via
program, drawn at random from the set of all problems that have ever been
solved, or might plausibly be solved, via program.  You must choose the
programming language you're going to use next Monday, before knowing which
problem you must solve.  You must solve the problem by next Wednesday, else
your failure will be announced on Usenet and you'll suffer 10% more flames
than usual.

There are only two sane choices:  Python -- or suicide <wink>.

> ...
> I have prepared an interesting small programming problem
> [at http://wwwipd.ira.uka.de/~prechelt/phonecode/]

This was fun!  I enjoyed it.  Excellent writeup of the problem.

> ...
> I would now like to extend this investigation to scripting languages:
>
>   o Are differences between implementations using the same language
>     smaller or even larger than for "standard" programming languages?

My guess is larger:  "high level" data structures and algorithms are so much
easier to experiment with in high-level languages that a greater diversity
of approaches is natural.

>   o Do systematic differences between different scripting languages
>     exist?

Yes.  For example, not all scripting languages use "#" as a comment
character <wink>.

>   o How do the scripting languages compare to standard programming
>     languages such as C or Java?

Shorter code, easier to read, easier to write, easier to test, easier to
debug, less likely correct on first run (due to lack of static
declarations), more likely correct on last run (due to extensive
error-checking in the languages' runtime support -- Perl has to be run
with -w to get this, though), slower to run an equivalent algorithm, but
more likely to come up with a better algorithm.

> ...
> The effort required is typically somewhere between 1 and 8 hours.

Goodness -- that's between a month and a year's work for Fredrik <wink>.

cheerleadingly y'rs  - tim






More information about the Python-list mailing list