Transiting from Perl: Learn Python or Ruby?

From: Goh, Yong Kwang (gohyongkwang_at_hotmail.com)
Date: 11/27/04


Date: 27 Nov 2004 08:13:15 -0800

Hi.

I've got this problem which may of us could have faced before. I must
first emphasize that I'm not trying to provoke any kind of unnecessary
debates over which language is better.

Let me explain my situation and why I'm trying to move away from Perl
for a particular application I'm developing. I've got an application
that I've built to automate the updating and generation for my
personal web site (text replacement and templating task) and I've
added in features such as incremental build (not re-generating files
that are not modified), automatic organization of files and
contemplating FTP upload feature. Hence it has grown from a 100 lines
script to 700+ lines file. In a way, it has outgrown Perl, which seems
to be getting less suitable for it. Making it object-oriented seems to
be the solution to the overly long and complex program.

But Perl's approach to OO is making the program messy and hard to read
as well, using a lot of arcane manipulation of @ISA and shift and
unshift for methods' parameters, clever but hard-to-read references
for class variables. It's support for OO looks more of clever hack and
a temporary ugly workaround rather than a consistent, clean and
elegant syntax for OO. I know this sounds offensive to Perl fans out
there but just my personal opinion, I may be wrong. Perhaps Perl 6
will address all these but I've yet to go check it up yet.

Not saying that Perl is bad and Python or Ruby is better. Nope that's
not my point. Perl is good for a quick, and short script that you want
to hack up in an hour to do something useful; hence flexibility in its
syntax is its strength. But for larger program which demands code to
be easily comprehensible and clean, Perl's flexibility becomes its
liability.

Therefore, I'm contemplating learning a new language, either Python or
Ruby, which promise cleaner and consistent syntax. So just seeking
opinion from experienced Perl programmers and developers here on which
would be a better choice for an existing Perl programmer and program
and why.

Thanks.



Relevant Pages

  • Re: Anonymous methods, blocks etc. (Cont. default block params)
    ... The syntax here is just ugly. ... * -> is not a common construct in any language that I know of to represent anonymous function declaration, while lambda is. ... in my opinion -> as an operator is not as elegant as other ruby constructs such as things like: ... Perl, but many of those same people are very happy that you did not pull over things from Perl like ...
    (comp.lang.ruby)
  • Re: Trouble running a unix command with a subroutine call
    ... the most infamous and most imaginative Perl programmer ever! ... During all my years of Perl programming, not once have I used subroutinesyntax. ... I find the author of this FAQ to be intellectually insulting by his indicating ...
    (comp.lang.perl.misc)
  • Re: print @{1} versus print @{11}
    ... >> -e syntax OK ... The name of a perl variable can be enclosed in if necessary ... > These are not idle questions by the way ... ... "Reply" at the bottom of the article headers. ...
    (comp.lang.perl.misc)
  • Re: Why arent THEY using Bigloo
    ... better sed/awk/grep, Python was a better Perl, Ruby is a better Python. ... So far he only knew Java and Pascal, but he likes Ruby. ... I don't like any of the above languages, though I don't know Perl, Ruby, Python too well. ... and the syntax is one of the things that makes them harder to learn. ...
    (comp.lang.scheme)
  • Re: String#to_rx ?
    ... > slowing regular expression matching. ... down matching is the one that executes arbitrary Perl statments, ... > changes to regexp syntax. ... I didn't even mention Perl in my original posting. ...
    (comp.lang.ruby)