[Pdx-pm] RE: [Pdx-pm] Software development and The Rules
Austin Schutz
tex at off.org
Wed Sep 25 15:34:23 CDT 2002
> 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?
Austin
More information about the Pdx-pm-list
mailing list