[geeks] Misuse of Java

Greg A. Woods woods at weird.com
Thu Nov 7 12:18:34 CST 2002


[ On Thursday, November 7, 2002 at 10:56:51 (+0000), David Cantrell wrote: ]
> Subject: Re: [geeks] Misuse of Java
>
> How many times do we have to rehash this?  Sometimes you need to squeeze
> every last drop of performance out of a system.  Sometimes you don't.
> Where programmer time is more expensive than run time, perl compares well.
> And anyway, perl isn't slow.

No, Perl is not slow.  However it's not much faster than the equivalent
Awk code, and it's only two lines shorter due to the less readable
multiple-assignment hack.  There are other aspects of the example Perl
code that I find far less readable too, including use of a construct you
specifically said you'd write differently.  :-)

>  This URL was posted earlier in this thread:
>   http://eris.quintessential.com/users/gypsy/techie_stuff/lang_compare.txt
> which quotes Kernighan and Pike as saying that of all the languages they
> tested, perl was the second fastest, second only to C.  And look at the
> number of lines of code taken to achieve that.  18 lines of perl.  150
> lines of C and 70 of C++.  You know as well as I do how much of a
> programmer's time is taken up by debugging, and how the number of bugs
> multiplies with the amount of code.

Another important quote from that same book:

	Both the Perl and Awk programs are short compared to the three
	earlier versions, but they are harder to adapt to handle
	prefixes that are not exactly two words.  The core of the C++
	STL implementation is of comparable length and seems clearer
	[and if you recall the table it runs about as fast as the perl
	version when the right data structure is chosen -GAW].
	Nevertheless, scripting languages are often a good choice for
	experimental programming, for making prototypes, and even for
	production use if run-time is not a major issue.

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods at ieee.org>;           <woods at robohack.ca>
Planix, Inc. <woods at planix.com>; VE3TCP; Secrets of the Weird <woods at weird.com>



More information about the geeks mailing list