[Pdx-pm] Software development and The Rules

Joshua Keroes jkeroes at eli.net
Thu Sep 26 16:02:35 CDT 2002

On (Thu, Sep 26 13:12), Austin Schutz wrote:
> 	If you asked something like 'how do I sort every phone number in the
> entire U.S.?', perhaps that's a different question. Maybe then I would
> care about memory usage or processing time a little more. Depends on the
> application. [snip]

So, consider the problem in that light then. My proposed solution to the
problem is extensible, as many elegant computer science solutions tend
to be. I used the local areacode to add that local PDX flavor we love so

I'm benchmarking the "obvious" Perl solution to the one from Programming
Pearls for both 7 digit numbers as well as 10 digit numbers. The beauty
of the solution is that the size of the numbers doesn't matter. You may
have to work a little harder to properly represent big numbers but the
theory is the same.

>       I'm not suggesting programming for performance is without merit. There
> are times when you have such a tremendous dataset or a need to do very fast
> data processing where it's critical to have the computer use optimal
> algorithms. It has been my experience that this is the exception, and not the
> rule. [snip]
>       Do you need to sort all the numbers in the portland area 20 times a
> minute?

Do I need to sort Portland's numbers 20x a minute? Of course not. It's a puzzle;
it's a game; it's a poser; it's a stumper. The question was handed to you and
the others to make you think and to [hopefully] make us better programmers as
a whole.

Let me tell you a joke I heard recently:

        A guy walks into a bar with a monkey. The monkey walks up to the
        pool table and eats one of the balls. The bartender says, "Why
        did he do that?" The guy says, "Oh he"ll eat anything."

        A couple of days later, the guy brings the monkey into the same
        bar, and the monkey picks up a peanut and shoves it up is ass,
        then takes it out and eats it. The bartender says, "Why did he
        do that?" The guy says, "Oh he"ll still eat anything, but ever
        since he ate that pool ball he checks it for size first."

I don't know about you, but I've never seen a monkey in a bar, much less
one that eats pool balls. That's still not going to stop me from telling
it at parties, it's a funny joke and I think I'm a [marginally] funnier
person for the retelling. 

See the point? Just because it's a silly situation that isn't likely to
occur in your life or mine doesn't mean we can't take the lesson

We can extend the same point to elementary school word problems. Hate em?
I sure did. Why the heck would two trains be on the same track traveling
at 90 mph and 120 mph at one another? Sounds like a bad movie plot to me.
Nevertheless, learning to figure out problems like that has helped me in
two fashions.

The obvious one first: I learned basic math.

The more intangible and far more important: I learned how to learn. 

We can both go on solving problems the same way we always have. There is
a time and a place for everything. Am I optimizing something that
doesn't have to be optimized? Possibly. I'll benchmark it and then we
can all find out. Nevertheless, when a similar problem comes along
though, you'll know the answer, see the pros and cons, and be able to
decide if you want to choose the usual solution or this one. Being able
to make that choice makes you more valuable.


PS Anyone intersted in a game of pool?

More information about the Pdx-pm-list mailing list