Of course, you can expect a bias on this mailing list, but I will give my two cents.
Perl: Great for quick, concise scripts you may need to hack together. Ugly syntax, but beautiful functionality.
Python: Not much experience here, so I can only say that I hear it is pretty powerful, but a bit annoying to use, according to some.
Ruby: Good for those who like to make elegant solutions to their problems. Tends to make readable programs that can be easily modified later. More powerful than Perl (IMHO), but not as concise. Definitely is the most enjoyable language to work with on a regular basis as it does not hinder you with weird syntax or restrictions, for the most part.
- Jake McArthur
···
On Apr 26, 2006, at 4:21 PM, Alan M wrote:
Hi,
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
Considering the fact that I won’t develop any web application, Which one
would be a better choice for me Perl or Ruby?
Ruby is incredibly well-suited to this.
As an example, many standard methods are either named (or aliased)
after standard shell commands.
FileUtils.cp, mv, ln
String#grep
etc, etc.
I recently introduced a sysadmin friend of mine to Ruby, and he raves
about how he can write something, come back to it later, and actually
tell what it does.
Apparently this is something Perl isn't good at? Heh.
--Wilson.
···
On 4/26/06, Alan M <nospam@hotmail.com> wrote:
Hi,
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
Considering the fact that I won't develop any web application, Which one
would be a better choice for me Perl or Ruby?
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
Considering the fact that I won't develop any web application, Which one
would be a better choice for me Perl or Ruby?
This is exactly the space I came to Ruby from (and still spend most of my time
in). I think Ruby is an excellent fit. It's clean, powerful, and
concise. It let's
you build the tools you want to, and be able to come back to in six months and
still understand them.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
I use both. I like them both. IMO, Ruby is more flexible than Python.
They go about things differently (Python is much more explicit in its
syntax), but the end result of scripts written in either language are
the same.
Python is more popular and has more thrid party modules/libraries, but
Ruby is catching up. If Rite and YARV ever become a reality and better
Windows support comes to Ruby (I believe it will), I can see Ruby
catching up to Python much more quickly.
Personally, I find Ruby more enjoyable to write and read than Python,
but you may not. You'll do fine with either (or both) of them in sys
admin scripting
They're both good choices. I'm fairly new to Ruby, but here's my 2 cents.
Plusses for Python:
- Tends to be a consistent language (not *too* many ways to do the same thing).
- Good library support.
- Good written docs (command-line pydoc docs are lacking though, IMO).
- Easily embeddable.
Minuses for Python:
- OO features seem a little trickier to me than Ruby's (bound vs.
unbound methods, class vs. static vs. plain vanilla methods).
- Some Python snobbishness in the community (just my opinion). Though,
the majority of Pythonistas are friendly and helpful.
- They put their docstrings *below* the thing they're documenting
instead of above it, where nature of course intended.
- Personally, not fond of the whitespace-dependent code formatting
(though many many folks claim they get used to it quickly).
Plusses for Ruby:
- Ruby seems a little more tailored for admin work than Python (since
Ruby has built in regexes, easy stdin/stdout)
- RDoc (documentation for your scripts comes right from plain old
comments above the thing they're documenting).
- Personally, I prefer its (Perl-like) string handling to Python's.
Minuses for Ruby:
- Lack of docs (good printed books though)
···
On 4/26/06, Alan M <nospam@hotmail.com> wrote:
Hi,
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
Considering the fact that I won't develop any web application, Which one
would be a better choice for me Perl or Ruby?
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
I'm new to ruby but have years of experience with perl and python. I generally perfer python over perl. But for oneliners and a lot of sysadmin scripting I've always felt that perl really outshines python.
I started to use perl for scripting maybe 10 to 12 years ago, when I
finally decided that I was trying to force 'awk' to do things it was
never meant to do. I wrote a lot of useful sysadmin-type programs
in perl (reading log files, summarizing data, etc). But many of those
scripts were written in bits-and-pieces. I start out needing a 3-line
perl script for some simple task. Then a week later I need to add
something else. Then I realize I could use the same script on two
different log files if I just made a few more changes. Before long,
my initial 3-line perl script is up around 700 lines. And, well, it's a
mess. It's a mess because it was never designed to be a 700-line
program, it was built up a few dozen lines at a time, over many
weeks or months.
When doing the same kind of scripts in ruby, I found that I do a
much better job of re-factoring the program as I added more
features to it, or as I found out that the data I needed to process
looks nothing like I was told it was going to look like. I *could*
write a good perl script if I started out with a fixed goal, and
stuck to whatever that original goal was, but that almost never
happens to me...
I used to do some Objective-C programming under NeXTSTEP,
and I found that the object-oriented support in ruby fits very
well with how my mind thinks. I've looked over python a few
times, and I know some excellent sysadmins who use python
for their work, but python just never quite caught my interest.
I'm not sure why. The usual complaint about python is the
whitespace-requirements that it has, and actually that does
not bother me at all. But for some reason I found ruby much
more compelling to the way that I think than I found python
to be.
···
On 4/26/06, Alan M <nospam@hotmail.com> wrote:
Hi,
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
--
Garance Alistair Drosehn = drosihn@gmail.com
Senior Systems Programmer or gad@FreeBSD.org
Rensselaer Polytechnic Institute; Troy, NY; USA
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
Considering the fact that I won’t develop any web application, Which one
would be a better choice for me Perl or Ruby?
Well, I don't know anything about Python and not a whole heck of a lot
about Ruby. I've been using Perl for fairly complex "scripts" for almost
ten years now. Like another poster on this thread, I got tired of trying
to manage large "awk" scripts and wanted a language that made it at
least possible to write structured readable programs. That turned out to
be Perl 4.
If I were starting this project or set of projects today, I'd use Ruby.
It's much better designed for objects than what's been tacked on to
Perl. I don't have any pressing need to rewrite my few thousand lines of
Perl into Ruby (or Python), and what I don't do in Perl is usually
number crunching that I do in R.
So questions for you:
1. Do you just want to learn a new language, or is there something
you've found Perl weak at?
2. Is readability of your code by others important? If so, would these
others be better off if you stuck with Perl, or migrated to Python or Ruby?
3. Have you looked at Perl 6? I must admit I haven't, and really don't
plan to. I'm happy with the current mix of Perl 5 (with my Perl 4 coding
style) and R, although there is one application I have coming up that's
a natural fit for Rails, and if I can sell it to the bean counters and
nay-sayers, that's what I plan to use.
I would argue that point. Back in 2002, when I was first learning Ruby, I was
coming to it from many years of using Perl for everything. To my joy I found
that, in general, my newbie-Ruby code was shorter and more readable than
equivalent Perl of a type that I would actually use in production.
I'm not talking the ultra-compressed, obfusicated, line-noise Perl, but the
kind of thing one writes when one wants to have a chance of easily
understanding it again 6 months later.
For a while I delighted in taking my Perl production code and rewriting parts
of it in Ruby, just to bask in it's readability and it's terseness. It was a
joy.
So, speaking as someone who uses Ruby for command line tools and system
automation scripts, I strongly support the use of Ruby for those sorts of
things, in lieu of Perl.
Kirk Haines
···
On Wednesday 26 April 2006 3:31 pm, Jake McArthur wrote:
Ruby: Good for those who like to make elegant solutions to their
problems. Tends to make readable programs that can be easily modified
later. More powerful than Perl (IMHO), but not as concise. Definitely
is the most enjoyable language to work with on a regular basis as it
does not hinder you with weird syntax or restrictions, for the most
part.
By the way, there are, of course, other plusses for Ruby that are
relevant if you're looking at it for other uses besides system
administration.
Also, Ruby's a very consistent language too (dunno why I only
mentioned this for Python above -- they're both pretty
self-consistent).
···
On 4/27/06, John Gabriele <jmg3000@gmail.com> wrote:
On 4/26/06, Alan M <nospam@hotmail.com> wrote:
> Hi,
>
> I am a Linux administrator and I use Perl for scripting.
> I do not develop any web applications. My programs are command line
> tools.
>
> At this phase I am thinking to upgrade my programming language to either
> Python or Ruby.
>
> Considering the fact that I won't develop any web application, Which one
> would be a better choice for me Perl or Ruby?
>
> Thank you,
> Alan
>
They're both good choices. I'm fairly new to Ruby, but here's my 2 cents.
[snip]
Plusses for Ruby:
- Ruby seems a little more tailored for admin work than Python (since
Ruby has built in regexes, easy stdin/stdout)
- RDoc (documentation for your scripts comes right from plain old
comments above the thing they're documenting).
- Personally, I prefer its (Perl-like) string handling to Python's.
Minuses for Ruby:
- Lack of docs (good printed books though)
I was talking about the way people generally use the two languages: Perl => quick hacks; Ruby => engineered solutions. Yes, if you typically engineer your Perl code, then your engineered Ruby code will probably be shorter.
- Jake McArthur
···
On Apr 26, 2006, at 4:41 PM, Kirk Haines wrote:
On Wednesday 26 April 2006 3:31 pm, Jake McArthur wrote:
Ruby: [...] More powerful than Perl (IMHO), but not as concise.
On Wednesday 26 April 2006 3:31 pm, Jake McArthur wrote:
Ruby: Good for those who like to make elegant solutions to their
problems. Tends to make readable programs that can be easily modified
later. More powerful than Perl (IMHO), but not as concise. Definitely
is the most enjoyable language to work with on a regular basis as it
does not hinder you with weird syntax or restrictions, for the most
part.
I would argue that point. Back in 2002, when I was first learning Ruby, I was coming to it from many years of using Perl for everything. To my joy I found that, in general, my newbie-Ruby code was shorter and more readable than equivalent Perl of a type that I would actually use in production.
I'm not talking the ultra-compressed, obfusicated, line-noise Perl, but the kind of thing one writes when one wants to have a chance of easily understanding it again 6 months later.
For a while I delighted in taking my Perl production code and rewriting parts of it in Ruby, just to bask in it's readability and it's terseness. It was a joy.
So, speaking as someone who uses Ruby for command line tools and system automation scripts, I strongly support the use of Ruby for those sorts of things, in lieu of Perl.
Kirk Haines
It could just be me, but I feel that the biggest difference is more cultural vs technical. You can write long elegant Perl code and you can write short obfusticated Ruby code. (If you were talking about OLD Perl obviously this is a different argument, but current 5.5+ is entirely capable.)
> More powerful than Perl (IMHO), but not as concise.
Could you given a small example program in Perl that is lengthier in
Ruby? (Just curious.)
I don't have any of my early Perl to Ruby conversions anymore (and
they were done under NDAs anyway). But I also remember that my
Ruby solutions tended to be shorter -- mostly because more powerful
approaches (like map and grep) clicked with me in Ruby but didn't
in Perl.
···
On 4/26/06, James Edward Gray II <james@grayproductions.net> wrote:
I think the consistency comes down to how many
different ways there are to do things. That makes
it more difficult to master the idioms, because
different code does similar things in different ways.
But there is a /huge/ plus for Ruby that is lurking
in the background. After spending the weekend at the
SDForum's Ruby conference, the meta-message for me
was that Ruby was great at building a /language/
geared towards solving a particular set of problems.
In standard terminology, they're known as Domain Specific
Languages. But I prefer to think of them as Design
Solution Languages.
Not since Forth have I seen a language in which it
was so easy to create a problem-specific vocabulary.
I used to wish for a Forth with C-style syntax. (I
didn't know enough to wish for OO-ness back then.)
It turns out that Ruby is it.
So my pick would be Ruby for the promise of huge
vistas of opportunity that will open up once you scale
the learning curve and reach the peak of the mountain.
(When I manage to get there, I'll tell how the view is.)
:_)
John Gabriele wrote:
···
On 4/27/06, John Gabriele <jmg3000@gmail.com> wrote:
On 4/26/06, Alan M <nospam@hotmail.com> wrote:
Hi,
I am a Linux administrator and I use Perl for scripting.
I do not develop any web applications. My programs are command line
tools.
At this phase I am thinking to upgrade my programming language to either
Python or Ruby.
Considering the fact that I won't develop any web application, Which one
would be a better choice for me Perl or Ruby?
Thank you,
Alan
They're both good choices. I'm fairly new to Ruby, but here's my 2 cents.
[snip]
Plusses for Ruby:
- Ruby seems a little more tailored for admin work than Python (since
Ruby has built in regexes, easy stdin/stdout)
- RDoc (documentation for your scripts comes right from plain old
comments above the thing they're documenting).
- Personally, I prefer its (Perl-like) string handling to Python's.
Minuses for Ruby:
- Lack of docs (good printed books though)
By the way, there are, of course, other plusses for Ruby that are
relevant if you're looking at it for other uses besides system
administration.
Also, Ruby's a very consistent language too (dunno why I only
mentioned this for Python above -- they're both pretty
self-consistent).
But that's not what I am talking about. It had nothing at all to do with a
cultural difference when I was comparing the two languages, and everything to
do with the languages. I was largely rewriting Perl code that was written to
be terse but readable/maintainable. There were isolated examples of a small
piece of Perl being shorter than equivalent Ruby, but for any given body of
code longer than a few lines, almost without exception, my newbie-Ruby (i.e.
I wasn't very sophisticated with my use of the language) was shorter and more
readable than Perl with equivalent functionality.
I had a directory of examples of this. It's one of the things that convinced
me that learning and using Ruby was a good thing to be doing.
Kirk Haines
···
On Wednesday 26 April 2006 3:47 pm, Stuart Stegall wrote:
It could just be me, but I feel that the biggest difference is more
cultural vs technical. You can write long elegant Perl code and you can
write short obfusticated Ruby code. (If you were talking about OLD Perl
obviously this is a different argument, but current 5.5+ is entirely
capable.)
The problem is that any single Ruby quick start code that I saw does
some AJAX web application
What I need to do with Ruby is text file processing, file manipulations,
and query oracle database. Is there any tutorial for command line
application developers? Is it easy to query Oracle 10g with Ruby?
Where can download RedHat and Windows version of Ruby?