[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby, Perl, Python

J. Cooper

2/13/2008 9:40:00 AM

As a new programmer (still in school), I'm curious as to the world of
scripting languages and their roles. I am learning Ruby (played a bit
with Rails a year ago, but more recently have been using it for my own
scripting projects), but I have zero experience with Perl and Python,
which seem to be pretty household names and thus I feel out of the loop.

I guess what I'm asking is: assuming I become a proficient Rubyist, is
there a reason to learn Perl or Python (beyond someone handing me a pile
of code in one of those languages and telling me to maintain it)?

Thanks,
J
--
Posted via http://www.ruby-....

10 Answers

Xavier Noria

2/13/2008 9:51:00 AM

0

On Feb 13, 2008, at 10:40 , J. Cooper wrote:

> I guess what I'm asking is: assuming I become a proficient Rubyist, is
> there a reason to learn Perl or Python (beyond someone handing me a
> pile
> of code in one of those languages and telling me to maintain it)?

Knowing more languages gives you more perspective. It is good to learn
something different for the sake of it, like Java or Erlang, but it is
also good to learn other options in the same language family, they are
not equivalent.

That said, being fluent in Perl takes effort, it is a big language
with gazillion modules.

-- fxn


Peter Hickman

2/13/2008 10:01:00 AM

0

J. Cooper wrote:
> As a new programmer (still in school), I'm curious as to the world of
> scripting languages and their roles. I am learning Ruby (played a bit
> with Rails a year ago, but more recently have been using it for my own
> scripting projects), but I have zero experience with Perl and Python,
> which seem to be pretty household names and thus I feel out of the loop.
>
> I guess what I'm asking is: assuming I become a proficient Rubyist, is
> there a reason to learn Perl or Python (beyond someone handing me a pile
> of code in one of those languages and telling me to maintain it)?
>
> Thanks,
> J
>

It's always a good idea to learn other languages if only so that you can
better judge when other people mouth off (good or bad) about another
language. There is 'opinion' and there is 'informed opinion' and it is
good to be able to tell the two apart. As for Perl or Python. To be
honest they are, along with Ruby, similar in many ways. I do my web
stuff in Perl and games in Python (the pygame package is a god send in
this respect). So what sort of projects do you have in mind?

It shouldn't take long to get a passing knowledge of either if you have
some projects to work on.

However if you don't already know then you should consider C, C++ or
Java. Again just so that you can hold an informed opinion about the
relative merits, strengths and weaknesses of these languages. Dynamic
languages like Ruby can spoil you, a fact that you might not appreciate
unless you have worked in the old school languages. It wouldn't hurt
your CV to have some knowledge of C, C++ or Java either.

Eivind Eklund

2/13/2008 11:40:00 AM

0

On Feb 13, 2008 10:40 AM, J. Cooper <nefigah@gmail.com> wrote:
> As a new programmer (still in school), I'm curious as to the world of
> scripting languages and their roles. I am learning Ruby (played a bit
> with Rails a year ago, but more recently have been using it for my own
> scripting projects), but I have zero experience with Perl and Python,
> which seem to be pretty household names and thus I feel out of the loop.
>
> I guess what I'm asking is: assuming I become a proficient Rubyist, is
> there a reason to learn Perl or Python (beyond someone handing me a pile
> of code in one of those languages and telling me to maintain it)?

There's always a reason to learn more languages - they expand the way
you think. For this I would, however, think it better to learn a
different kind of language rather than Perl/Python. I personally
think you'll be a better programmer for knowing C and assembly
programming, as that gives you some idea of how things work at a lower
level - closer to the hardware.

I also think that learning a functional language (ML, Haskell) will be
helpful - teaching you new ways to think. And SQL is always useful
(though you'd be better off also learning the underlying model, as SQL
is a poor implementation).

Eivind.

M. Edward (Ed) Borasky

2/13/2008 2:51:00 PM

0

J. Cooper wrote:
> As a new programmer (still in school), I'm curious as to the world of
> scripting languages and their roles. I am learning Ruby (played a bit
> with Rails a year ago, but more recently have been using it for my own
> scripting projects), but I have zero experience with Perl and Python,
> which seem to be pretty household names and thus I feel out of the loop.
>
> I guess what I'm asking is: assuming I become a proficient Rubyist, is
> there a reason to learn Perl or Python (beyond someone handing me a pile
> of code in one of those languages and telling me to maintain it)?
>
> Thanks,
> J

Well ... in the absence of a financial motive, like being paid to
maintain code in Perl or Python, I would recommend learning them only if
there is some functionality implemented in one of them that you want to
hack on. Focus is a wonderful thing, and Ruby is deep enough that such
focus will be repaid.

Someone else on this thread recommended learning a functional language
like Haskell. While knowing a functional style is important in the
theoretical computer science world, it isn't necessarily going to make
you a better programmer. I think it's really more the other way around
-- if you're a good programmer, you'll learn functional programming
easily and think that it made you better. If you're not a good
programmer, you're better off getting good in one (imperative) language
for a few years.


Phlip

2/13/2008 4:43:00 PM

0

J. Cooper wrote:

> I guess what I'm asking is: assuming I become a proficient Rubyist, is
> there a reason to learn Perl or Python

No. Survivors of those languages typically stop their search for Nirvana here.
Then they write lean, simple versions of the systems they tried to get in those
languages. Then you download those as gems, and keep going.

> (beyond someone handing me a pile
> of code in one of those languages and telling me to maintain it)?

Rewrite it all in Ruby, in like 5% of the line count.

--
Phlip
http://www.oreillynet.com/ruby/blog/2008/02/as...

J. Cooper

2/13/2008 6:39:00 PM

0

Thank you for the replies. I should have mentioned that I do know some
other, different languages (PHP, C, C#, and a bit of C++ and Java). I
really like C# and love visual studio and just in general the polish
that comes from a company throwing money at a language/framework. But
there is a definite appeal in the dynamic style as well, and I'd like to
be competent in both. (Not to mention, C# is essentially WIndows-only.)

I like what was said about focus. In fact, the Pygame thing intrigues
me, as I like to imagine myself writing games (I've even started a
little RPG using Gosu in Ruby).

I suppose my main interest is, are there things that can be done in
Perl/Python that cannot be done in Ruby? Pygame may be an example, and
an appealing one. It's things like that that intrigue me :)



--
Posted via http://www.ruby-....

Chad Perrin

2/13/2008 7:23:00 PM

0

On Wed, Feb 13, 2008 at 11:50:44PM +0900, M. Edward (Ed) Borasky wrote:
> J. Cooper wrote:
> >As a new programmer (still in school), I'm curious as to the world of
> >scripting languages and their roles. I am learning Ruby (played a bit
> >with Rails a year ago, but more recently have been using it for my own
> >scripting projects), but I have zero experience with Perl and Python,
> >which seem to be pretty household names and thus I feel out of the loop.
> >
> >I guess what I'm asking is: assuming I become a proficient Rubyist, is
> >there a reason to learn Perl or Python (beyond someone handing me a pile
> >of code in one of those languages and telling me to maintain it)?
> >
> >Thanks,
> >J
>
> Well ... in the absence of a financial motive, like being paid to
> maintain code in Perl or Python, I would recommend learning them only if
> there is some functionality implemented in one of them that you want to
> hack on. Focus is a wonderful thing, and Ruby is deep enough that such
> focus will be repaid.
>
> Someone else on this thread recommended learning a functional language
> like Haskell. While knowing a functional style is important in the
> theoretical computer science world, it isn't necessarily going to make
> you a better programmer. I think it's really more the other way around
> -- if you're a good programmer, you'll learn functional programming
> easily and think that it made you better. If you're not a good
> programmer, you're better off getting good in one (imperative) language
> for a few years.

I disagree. Learning new paradigms of programming well enough to really
grok how they work teaches new patterns of thinking -- which broadens and
deepens one's understanding of programming in general. It makes one a
better programmer. Only those incapable of really grasping the
underlying philosophies of varying programming paradigms will not benefit
from learning a new language whose focus is in a different paradigm than
previous languages. Even learning different languages in the same family
will make one a better programmer, when the reasons for these differences
are understood.

I learned more about MS Windows by three months of familiarization with
Linux systems, when I first encountered Linux, than I had in the
preceding three *years* of in-depth use and support of MS Windows.
That's because I learned a lot about the differences between MS Windows
and Linux systems, which gave me valuable insights into the reasons for
these differences -- good, bad, and just plain different. The same
applies to learning more programming languages.

That's not to say that one should split one's focus between multiple
languages early on. As much as possible, new programmers should focus on
learning *a language* for quite some time. When really proficient with
that language, *then* learn a new one. Learning to program well is best
pursued with a philosophy of serial monogamy, as far as I'm concerned,
with enough dalliances with past programming language partners to stay
familiar with them and be able to reasonably compare and contrast them
with the current focus. As more languages are learned, the time and
effort necessary to learn a new language should decrease. An arbitrary
guesstimation of a schedule of learning languages might look something
like this:

Foo: Five years.
Bar: Three years.
Baz: Two years.
Qux: One year.
Quux: One year.
Quuux: One year.
Quuuux: One year.
. . .

--
CCD CopyWrite Chad Perrin [ http://ccd.ap... ]
Thomas McCauley: "The measure of a man's real character is what he would do
if he knew he would never be found out."

James Gray

2/13/2008 7:23:00 PM

0

On Feb 13, 2008, at 12:38 PM, J. Cooper wrote:

> I suppose my main interest is, are there things that can be done in
> Perl/Python that cannot be done in Ruby?

In a word, no.

All three are turning complete programming languages, so they are all
capable of doing the same things.

Now, that's not to say things won't be easier in one language or
another, due to language design or the presence of a library like
pygame.

James Edward Gray II

Chad Perrin

2/13/2008 10:27:00 PM

0

On Thu, Feb 14, 2008 at 03:38:50AM +0900, J. Cooper wrote:
> Thank you for the replies. I should have mentioned that I do know some
> other, different languages (PHP, C, C#, and a bit of C++ and Java). I
> really like C# and love visual studio and just in general the polish
> that comes from a company throwing money at a language/framework. But
> there is a definite appeal in the dynamic style as well, and I'd like to
> be competent in both. (Not to mention, C# is essentially WIndows-only.)
>
> I like what was said about focus. In fact, the Pygame thing intrigues
> me, as I like to imagine myself writing games (I've even started a
> little RPG using Gosu in Ruby).
>
> I suppose my main interest is, are there things that can be done in
> Perl/Python that cannot be done in Ruby? Pygame may be an example, and
> an appealing one. It's things like that that intrigue me :)

You can do all the same stuff in all three languages, in general. Ruby
and Perl are a little better for doing functional-style stuff, Ruby and
Python are a little better for doing OOP-style stuff, and so on -- but
these are all relatively minor differences in the grand scheme of things.
The same goes for performance differences -- they're all slow by some
standards, and they're all fast enough for any niches where I'd consider
using something that isn't compiled to an executable binary as far as I'm
concerned.

The major differences, for most people, are:

1. a matter of taste
2. how much someone else has already done for you

Of the three, Perl has the most libraries, and Ruby probably has the
least. On the other hand, Ruby libraries are being created at breakneck
speed, and each language has strengths and weaknesses with regard to
coverage of certain library niches. Well, Ruby and Python do, anyway. I
have yet to have difficulty finding any library types that are
represented in Ruby or Python and not in Perl (CPAN is my friend).

--
CCD CopyWrite Chad Perrin [ http://ccd.ap... ]
print substr("Just another Perl hacker", 0, -2);

David Moreno

2/13/2008 11:21:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Feb 13, 2008 1:38 PM, J. Cooper <nefigah@gmail.com> wrote:

> Thank you for the replies. I should have mentioned that I do know some
> other, different languages (PHP, C, C#, and a bit of C++ and Java). I
> really like C# and love visual studio and just in general the polish
> that comes from a company throwing money at a language/framework. But
> there is a definite appeal in the dynamic style as well, and I'd like to
> be competent in both. (Not to mention, C# is essentially WIndows-only.)


Well, you might be interested in Mono which is a free and nice
implementation of .NET. Anyway, you also might be amazed on that not only
Windows throw money at C# and .NET, other big companies also throw huge
amounts of money to open languages.

--
David Moreno - http://www....
Yes, you can.