Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: The Spirit of Perl

by deprecated (Priest)
on Jan 30, 2001 at 04:00 UTC ( #55136=note: print w/replies, xml ) Need Help??


in reply to The Spirit of Perl

Hi, John.

I wanted to contribute a little to this thread. As flay mentioned, your heart is clearly in the right place. But (yes, there is a 'but...'), it is very important to keep an open mind. One of perl's major colloquialisms or mottos is "TIMTOWTDI" or, "There Is More Than One Way To Do It," or, as I like to say, "Several Methods Exist For The Accomplishment Of Your Task" SMEFTAOYT. < grin >

flay's observations are correct. To say that no one language is as good as perl or will ever be as good as perl is painting with an awfully big brush.

Im going to give you a couple examples, and I hope the rest of the monks realise I'm not trolling here.

Languages like Python and Pascal are excellent languages to teach with. I think most professional programmers learned on one of those, though many also learned on C. Perl is often very confusing to novice programmers because it is so loosely typed, and things can appear vague. In some cases, "One Way To Do It" is easier to understand than others.

While Perl is a truly cross-platform language, sometimes its necessary to have a cross-platform compilable program. I work daily in the OpenNap server package, which is written in C. More information is available on my home node. It simply isnt practical to write that software in perl. Sure, perl could do it, and there *is* a napster server written in perl, but one begins to wonder why you would use perl for that task rather than something a little more appropriate. (as an aside, pircd /* an IRCd written in perl */ is excellent!)

I had a question, a couple hours ago, about behaviour of the Bourne-Again SHell (bash) in unix. I was trying to figure out what this command would do:

bash$ echo "foo" >*
Would it overwrite all the files in the directory with "foo"? Would it overwrite the first file in the directory? To test it, my solution was thus:
bash$ for i in foo bar baz bletch ; do cp /dev/null $i ; done bash$ echo "foo" >*
The first line is my example. Sure, I could have done that in perl:
foreach qw(foo bar baz bletch) { open I, ">$_"; print I $_; close I }
But one has to wonder why somebody would go to the trouble to do that when, in this case, clearly, its quicker and more concise to whip it up in a shell oneliner.

I love perl just as much as the next guy. I've got the bumper stickers and t-shirts. Im a #perl chanop and the whole shebang. Sometimes, however, perl is just not the right tool for the job. Sometimes, something else can do that job better than perl. Perl is not the biggest programming language out there, or the most popular, or the best, or any of that. Perl just happens to be a language that we all love a great deal.

Before I step down from this Soap Box, I wanted to give you a link thats been tossed about this great perl community of ours for a while.
http://www.perl.com/pub/2000/12/advocacy.html

Keep the shiny side up,
dep.

p.s., for anyone interested, the shell loves you. we get "ambiguous redirect" in bash if we pass it '*' as our redirect filename.

--
i am not cool enough to have a signature.

Replies are listed 'Best First'.
Re: Re: The Spirit of Perl
by MeowChow (Vicar) on Jan 30, 2001 at 05:54 UTC
    foreach qw(foo bar baz bletch) { open I, ">$_"; print I $_; close I +}
    Not to detract from the excellent points you make, but you could have also done:
    `touch $_` for qw(foo bar baz bletch);
    SMEFTAOYT ;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://55136]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2019-06-24 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (97 votes). Check out past polls.

    Notices?