They only rated their Perl skill
by arhuman (Vicar) on Jan 02, 2002 at 22:30 UTC
|
Alas, on the frontpage (in red) you can read :
Hi, the shootout is an unfinished project. I've decided to discontinue updates to it for now while I work on some other things. Thanks for everyone's help.
Which is really a sad thing as their perl code is crippled,
with unnecessary code : (lines number is part of their scoring system)
- useless variables initialization (my %hash=())
- useless buffering
while (read(STDIN, $_, 4095)) {
$_ .= <STDIN>;
...
}
instead of
while(<STDIN>) {
...
}
- some examples seem really partial to me :
echo `wc` is allowed for bash, whereas the Perl solution don't use the one line solution (print `wc`;)
- ad nauseaum...
"Only Bad Coders Code Badly In Perl" (OBC2BIP)
| [reply] [d/l] [select] |
Re: Perl's rank among languages
by jmcnamara (Monsignor) on Jan 02, 2002 at 22:54 UTC
|
#!/usr/local/bin/perl
use integer;
shift;
while (<>) { $tot += $_ }
print "$tot\n";
Since the number of lines is a judging criterion these 4 lines could have been written as follows:
#!/usr/bin/perl -pl
$tot += $_ }{ $_ =+ $tot
Also, using integer is unnecessary and is bound to slow the code down.
However, as arhuman points out, it looks like the contest is on hold for now.
--
John.
| [reply] [d/l] [select] |
|
| [reply] |
Re: Perl's rank among languages
by petral (Curate) on Jan 03, 2002 at 00:28 UTC
|
Notice that if you select only the string, array, hash and io processing (about 1/2 the tests) and give equal weight to cpu usage and lines of code, perl comes in first.  Which, as has been mentioned, says something about the right tool for the job.
  p | [reply] |
Re: Perl's rank among languages
by scott (Chaplain) on Jan 02, 2002 at 23:32 UTC
|
Note also that the main page says Disclaimer No. 4: Please read the pages on Methodology, the FAQ, and my Conclusion before you flame.
In particular, the Methodology section
makes it clear that some tests are deliberately written
non-idiomatically so that they can test common features
of all the languages.
| [reply] |
|
In particular, the Methodology section makes it clear that some tests are deliberately written non-idiomatically so that they can test common features of all the languages.
This notion of non-idiomatic should be clearly defined, to my mind, it's (at best) unfair, beccause it gives a serious advantage to the ones considered as 'idiomatic' (C?). Moreover why compare languages if you can't use their own strengths ?
Anyway I don't think that adding useless instruction in Perl make it 'non-idiomatic Perl'.
Furthermore look at other language examples I DO find that some of them use language specific idioms.
(some haskell and ruby code for example)
UPDATE :
From the methodology text :
Since functional languages have such a different mode of expression, I allow them more leeway
In some cases I'm not really measuring the speed of a language, but how good of a programmer I am in that given language.
"Only Bad Coders Code Badly In Perl" (OBC2BIP)
| [reply] |
|
This notion of non-idiomatic should be clearly defined, to my mind ...
True. Many moons ago I actually read a lot of the site and I
seem to recall that certain tests were required to be
written as close as possible to some predetermined
form. If my mind isn't fibbing, that could easily require
variable initialization, etc.
To continue the tete-a-tete of qouting:
Disclaimer No. 1: I'm just a beginner in many of these languages, so if you can help me improve any of the solutions, please drop me an email.
Thanks.
Disclaimer No. 2: These pages are provided for novelty purposes only. Any other use voids the manufacturer's warranty. Do not mix with
alchohol. Some contents may consist of recycled materials.
By the way, the word Great in the title refers to quantity, not quality
I'm doing it so that I can learn about new
languages, compare them in various (possibly meaningless) ways, and most importantly, have some fun.
| [reply] |
|
|
The Methodology reveals a lot.
Measuring CPU
...Each test is executed as a sub-process of a Perl script that...
Measuring Lines of Code
...For each test language, I use a (Perl) script to...
How Tests Are Graphed
...For plotting, I wrote a Perl script that...
Now where's that usefulness metric?
YuckFoo
| [reply] |
(ar0n) Re: Perl's rank among languages
by ar0n (Priest) on Jan 02, 2002 at 21:40 UTC
|
| [reply] |
|
Use the best tool for the job.
The job in question is improving some rather public
Perl code, not frothing-at-the-mouth language advocacy.
Update: I do appreciate the
sentiment wrt. actual unreasoning-advocacy, though.
--
:wq
| [reply] |
|
| [reply] |
Re: Perl's rank among languages
by YuckFoo (Abbot) on Jan 03, 2002 at 00:01 UTC
|
On the 'scorecard' page, weights can be assigned to each
of the measurements, CPU, Memory, and LOC. Perl ranked 14
when only CPU usage is considered. If you enter a weight of
'1' for each measurement to consider all three equally, Perl
ranks 8th, 4th if you don't count languages I've never heard
of. | [reply] |