Re: Scripting question, [small programming question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2005-05-25 at 12:20 -0400, Claude Jones wrote:
> On Wednesday 25 May 2005 11:03 am, Les Mikesell wrote:
> > On Wed, 2005-05-25 at 09:02, Claude Jones wrote:
> > > What do you guys think?
> >
> > I think perl was really designed to be your second program language -
> > that is, the one you turn to when sh, awk, sed, etc. don't quite handle
> > the problem you want to solve - instead of being the one you learn
> > first.  As such, you'd already understand programming concepts,
> > regular expressions and have a favorite style that perl can mimic
> > closely.  Python people like to make fun of the perl concept that
> > "there's more than one way to do it", but you'll often find in
> > practice that the problem you need to solve is already 90% done and
> > you just need some slight variation of your own.  Perl generally
> > lets you embed existing programs, run them and use their output,
> > or you can even embed perl into an existing program to use its
> > strengths.  With an object oriented approach and a mentality that
> > says there's only one way to do things, you'll end up throwing out
> > working code that has years of testing behind it and repeating most
> > of the old mistakes yourself.
> >
> Interesting points. What about this argument that Python scripts are more 
> intuitive/readable? 
Well, I don't share this opinion. I consider both Perl and Python to
equally [un]readable and [un]maintainable, otherwise is would not have
been possible for both languages to evolve a plethora of "modules".

As far as scripts, you might want to write for occasional use (Such as
"How do I rename/move/reformat these 5000 image files?") are concerned,
to me Perl is a natural choice. As some people put it: "Perl is not much
more than an extended sed" - It's an exaggeration, but there is a grain
of truth in this statement, but ... that's exactly what you want for
such "occasional quick'n'dirty scripts"!

Both languages are suitable for midscale projects. For larger projects I
would choose neither of them.

Finally, there is another criterion, which had been neglected so far:
Script languages often are used for "rapid prototyping" and "quick
solutions" - There, personal knowledge and preference by far outweighs a
language's pros/cons - It's implementation time that matters.

Ralf 




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux