holy war (was: Re: [NCLUG] speaking of high school)

S. Luke Jones luke at 6d.com
Tue Feb 13 13:29:51 MST 2001


mike cullerton wrote:
> ...
> so, do y'all find something you like (perl, python, whatever) and usually
> stick with it and learn it well? do you try to find the right tool for the
> job and work on each project independently from another? do you maybe mix
> and match and for instance write a simple perl script to generate a random
> password and call it from within my php program?

There are mechanics who've got a huge red rollaway toolbox full of
tools.
There are people like me who get by with a leatherman. That does 99% of
everything I need, but I'd be crazy to get by with that if I owned a
British sports car. :-)

But before someone sneers at the guy with the leatherman (or the guy who
inspired the saying "when all you have is a hammer, everything looks
like
a nail") we have to remember that it takes a long time to get proficient
with a new tool.

In the example you've posed, there are two proposals on the table:

- generate the passwords natively inside the PHP script

- from within the PHP script, invoke an external program (gpw or apg
or a quick Perl hack or whatever)

If you're batting out a quick hack that you don't plan to come back
to, then use your favorite programing language and be done with it.
If it's something that will require some maintenance and have a bit
of a life cycle associated with it, that's when you really have the
"right tool for the job question."

Assuming that you can justify treating it as a semi-serious software
engineering exercise, then...

My preference in this case would be the latter. It gives you the
advantage
of modularity -- you can fix the password generator or the PHP script
without having to fix both at once. There's also the chance to leverage
someone else's effort at writing a password generator. This is
especially
relevant since the topic is random password generation: as a math major,
you either are or could be confused for one of those dreadful number
theory types who freak out when they see bad examples of randomness.

On the downside, there is a performance hit for opening a pipe to make
a new password, but this isn't slashdot you're developing. You probably
will get one or two hits a day? Something like that? So what if you
open up a pipe.

Luke Jones



More information about the NCLUG mailing list