[Pdx-pm] RE: [Pdx-pm] Software development and The Rules

Austin Schutz tex at off.org
Wed Sep 25 16:20:25 CDT 2002


On Wed, Sep 25, 2002 at 01:34:23PM -0700, Austin Schutz wrote:
> > For example:
> > 
> > Q: What's the fastest, most space-efficient way to sort all
> > of Portland's 503 phone numbers? 
> > 
> 
> for(@numbers) {
>   s/[^\d]//g;
> }
> 
> @sorted = sort { $a <=> $b }(@numbers);
> 
> 	Oh, you meant fast and small for the computer. Does it matter?
> 	Most of the time optimal solutions are ones that are easy to
> write, unless you have a specific need for performance.
> 
> 	Of course, there's still some point where you have to wonder.
> A modern pentium 4 processes what, 2.5 billion instructions per second?
> If it takes Windows two minutes to boot, how many of the billions of
> instructions were pure bloat?
> 

	Btw, since we're discussing "the rules", one point that might be
made is that the rules tend to change over time. A few years ago it might
have been nutty to just slurp the phone numbers for a large city into
an array. Now with ram being cheap, why not?
	Same with the language in general. Additions like our() and qr//
have (and will) change standard practice.
	Old code definitely doesn't age like wine. Well, not my code
anyway. :-)

	Austin



More information about the Pdx-pm-list mailing list