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

Michael Dwyer mdwyer at sixthdimension.com
Tue Feb 13 16:00:42 MST 2001


> > Thus spake mike cullerton:
> >> anyway, i'm wondering if there are standard (good) ways of generating
> >> random passwords out there.

I'm actually rather partial to the Quantum Link and later AOL method -- grab
two words out of the dictionary, and join them with a random number.  The
passwords are easier to type and remember than Ad4tr7Xu is.  Of course, they
are longer, too, but....  It all depends on how you balance security against
ease of use...

> now, to start a holy war :)
> anyway, one of the things i'm learning is an application of the 'best tool
> for the job' law. as a mechanic, i learned to appreciate tools, and more
> particularly, the right tool for the job. the same could be said for tools
> in the kitchen, the garden, whatever.

Well, to take your analogy and beat it into a sensless pulp, programming is
often a get-it-done-yesterday kind of prospect.  You use the tool that is
most convenient even if it isn't the best.  This is why so many screws get
unscrewed with butter knives.  Now, the next person who tries to use the
screw and finds it stripped to uselessness will hate you with a passion, but
at the time you needed it, the knife worked.

Luke pretty much hits the nail right on the head with this one.  If you have
no time, you use what you know.  If you have time to think, you do it right.

> php is great for creating dynamic web content based on entries in a
> database. it's also been great in that it's easy to learn and use. so,
> someone like me who is new to programming can pick it up quick and focus
on
> other areas like general programming theory and technique.

The funny thing is that Computer Science doesn't really teach languages, so
much as /programming/.  More on this in a sec...

> for my particular problem pull a random item from an array. i don't know
if
> php can even do this. i couldn't find any reference to it in any php docs,
> while researching this, but i did find a reference to it in some perl docs
i
> looked at.

Ah, now see here is my example.  In C, I would find the length of the array,
choose a random number from 0 to the length, then access that array element.
In PHP I would... Uh.  I'd do the same thing.  In C++... well, I'd still do
the same thing, but I beat it into an object shape first. In PERL, I would
do the same thing (cuz I don't know PERL all that well, and had no idea
there was as get-random-element-from-array function.)  In shell scripting, I
would pipe the list through wc to find how many lines, then use tail and
head to get a random line out.  Same old thing, different languages.

Programmers learn programming.  They learn languages because they kind of
have to.  But you will find that most programmers can claim to /know/ myriad
languages, but you will always find them doing the same things in every
language, and looking in handy books to figure out the difference between
their languages.  IF THEN ELSE is a contstruct you find everywhere.  But I
always have to crack open a book to figure out how to do the syntax.  Does
it end with endif? elif?  fi?  Brackets?

> and there's also python which i know nothing about.

I think it is a kind of snake. <shrug>

> 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?

Personally, I find a language I like and use it to my own detriment.  I will
write painful things in C rather than write it in one line of PERL, because
I don't know PERL, yet.  I know full well that PERL would kick butt in this
usage, and would the the right tool... But C is the language I am good at
right now.  It was quicker to do it wrong than right.

My only big 'project' uses a mix of PHP and C.  Each one has its strengths
and weaknesses.  In this case, PHP kicks butt in the web environment, but I
needed to write amateur radio interfaces in C.




More information about the NCLUG mailing list