I want to learn a new language...

Stuart Jansen sjansen at buscaluz.org
Thu Feb 15 11:51:22 MST 2007


On Wed, 2007-02-14 at 14:30 -0700, Bryan Sant wrote:
> I sincerely want to learn a new language well, but
> as I start to dig in to each language, I find warts that are even
> uglier than the step-child that is Java.

> I'd like to learn one of the following well:  Python, Ruby,
> or Perl.

Frankly, you should learn all three. As Hans has already pointed out,
not all scripting languages are created equal. Each has strengths that
makes it best for solving certain kinds of problems. Often because of
libraries, but sometimes just because of the design of the languages.
For example, PyNumeric, matplotlib & PyGTK are three great things about
Python no one else has mentioned yet. But regular expressions in Python?
Makes me wish I had an IDE. If I know I'm going to be doing a lot of
regex, I'll pick Ruby or Perl instead.

But of course, that's not very helpful is it? Here's a shorter version:
pick one to focus on for now, but keep dabbling with the others to
cross-pollinate ideas from each community.

The more I think about it, the more I think you should focus on Python.
I think it's the most likely to fit your development style. Python
places a lot of emphasis on well engineered solutions anyone can
approach. Unfortunately in Python that often means There Is Only One Way
To Do It Foo'. (TIOOWTDIF) That's good and bad. In my experience it
means that corner cases of the language get less attention. And
sometimes the Python solution isn't the solution that fits my brain
best.

But that's not really something you notice until you spend time with
other languages. With the resurrection of Jython, there's more chance
for you to combine Java and Jython in a single project taking advantages
of the strengths of each. Because the rebirth is so recent, though, I do
worry about Jython stagnating again. One thing that frustrates me about
Jython is it implements an older version of the Python standard and some
really nice stuff was added to Python 2.4.

The next bit of advice is a little harder to give. A similar argument
can be made for learning Ruby because of JRuby. Perhaps even stronger
because it's officially sponsored by Sun now. But JRuby isn't complete
and still has even bigger performance problems than Ruby. That said, a
stated goal of Ruby is to make programmers happy and for me at least, it
does just that. It's a clean language that fits my brain well. Some of
the freedom of Perl, without the excess. Some of the opinionated-ness of
Python, without the excess. A little secret sauce of its own.

Frankly, though, I have to admit I think you'd be best served by making
Perl your secondary focus. Every sysadmin should know Perl. Programmers
can also benefit. For example, you need to do some refactoring but your
specific scenario covered by your IDE. Carefully building a
one-time-only solution is stupid. Because Perl is so powerful and
flexible, this is one of the things its great for: quick, temporary
solutions. (If the phrase "one-time-only solution" makes you
uncomfortable, replace it with the word "prototype".)

Because Perl has people like Damian Conway abusing it in strange ways,
it's an extremely robust language. I've thrown sick and wrong programs
at it because I was in a hurry and not concerned about perfect design.
Python choked and fell over, Perl rolled with the punches and gave me my
solution. I personally don't have enough confidence in the current
version of Ruby to even try such a thing.

If that isn't enough for you, consider this: Perl has a very different
culture from Java. It's stupid to claim one is always right and the
other always wrong. If you're willing to invest the time to learn Perl's
approach to well engineered solutions, you will learn skills rarely
encountered in the Java world. Being able to draw on the knowledge of
each philosophy will make you a better programmer.

For example, a person experienced in meta-programming probably never
would have designed the tragedy that was J2EE 1.0. But meta-programming
is a skill easiest learned in a more flexible language. Although it's
possible in Java, it's harder and therefor less commonly encountered.
The meta-programming approaches you learn from Python/Perl/Ruby will
make you a more powerful Java programmer.

By the way, the nature of my advice is proof I'm trying to be objective.
My personal preference is Ruby, Perl, Python in that order. My advice to
you is Python, Perl, Ruby in that order.

-- 
Stuart Jansen              e-mail/jabber: sjansen at buscaluz.org
                           google talk:   stuart.jansen at gmail.com

"However beautiful the strategy, you should occasionally look at 
the results." -- Winston Churchill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://plug.org/pipermail/plug/attachments/20070215/6ff1a39c/attachment.bin 


More information about the PLUG mailing list