Stefano Palazzo
Stefano Palazzo

Reputation: 4332

What will a Python programmer gain by learning Ruby?

I am going to be learning Ruby, Haskell and Prolog at university. Now, I'm wondering what should get most of my attention. I have half a year to do all three, which means I need to decide on one language to get my extracurricular time. The others I will learn just enough to do very good in the course.

I am familiar enough with Haskell and Prolog to know that learning them will teach me a few very important concepts of computer science. I'm not so sure about ruby.

Going through a few tutorials and introductions, I get the impression that ruby is a lot of shallow magic. Now I'm asking the ruby people: What will I have gained, should I decide never to use it again, after I've spent half a year learning it, that Python didn't already teach me.

This question is not intended to "make the case" for ruby, although I realise this is a potential topic of great argumentation.

I use Python for all my CS work now. I have done quite a bit of functional programming with it as well. I am also, already, quite familiar with object oriented programming (in Java, Python and C#). And I will, as I said, do some Logical programming with Prolog.

What then is left for Ruby to teach me?

To further dilute the question:

I can't help this question being argumentative. But an ideal answer to this question will mention a profoundly important concept of theoretical computer science that ruby helps the programmer use and understand in order to gain scientifically adjuvant knowledge.

To candidates I came up with are Meta-programming and Multi-threading. I don't know if ruby is particularly great to learn either of them.

Upvotes: 16

Views: 2104

Answers (5)

RHSeeger
RHSeeger

Reputation: 16262

The answer to the following two questions are, overall, the same:

  • If I already know Python, what will I learn from Ruby?
  • If I already know Ruby, what will I learn from Python?

The answer to both being:

  • Nothing important, other than a slightly different way of doing things.

They're both dynamic OO languages. Ruby lends itself to being slightly more functional, while Python has certain other things that are nice (list comprehension). Overall though, you're not going to learn much that's generally applicable to computer science by going from one to the other.

Upvotes: 5

the Tin Man
the Tin Man

Reputation: 160553

I've been programming professionally over 20 years, and have many different languages, from assembly and C through various SQLs. Having that range gives me a good toolbox to pick through when I need to do something.

Every language has its strengths and knowing what they are will help as you progress in your career. No language is the end-all, be-all of programming languages and the more languages you know, the more you can accomplish and the easier you'll find it to learn new ones.

Upvotes: 3

Josh Lee
Josh Lee

Reputation: 177500

Ruby and Python are quite similar in terms of the real CS that your brain will get out of it — the differences are largely cosmetic and pragmatic. Areas in which they are essentially the same:

  • Both languages are strongly, dynamically typed.
  • Both support many paradigms like functional, object-oriented, etc.
  • Ruby has a little more fluff/sugar (similar to Perl), while Python believes that explicit is better than implicit.

If you are interested in interpreters, frameworks, and testing, it can be worthwhile to battle the two, but from a theoretical standpoint you will learn much more from Haskell or Prolog.

Upvotes: 5

robbrit
robbrit

Reputation: 17960

For the most part, nothing. Most of Ruby's strengths/weaknesses are the same as Python's, except that Ruby is slightly more "functional". However if you have Haskell as an option, much more can be learned about functional programming from Haskell than from Ruby.

Second, if you're looking at things from a theoretical computer science perspective, then Ruby is far from a language of choice. Ruby and a lot of its libraries break a lot of standard OOP dogma which I believe many academics would find repulsive (this is based mainly on my chats about languages with various professors).

From an academic perspective I think Haskell would have the most appeal to you. If you're interested in AI or logic, then Prolog is also an excellent choice.

Upvotes: 8

egervari
egervari

Reputation: 22512

If you want to learn computer science stuff, learn Scala. That is the computer science language of the future. See if you can learn that one ;)

Otherwise, Ruby is a good language to learn if you want to more marketable after your studies, as it's probably the easiest to get a job with afterward.

Algorithms and data structures are all well and good too, but don't forget architecture and high-level design. This is really important - to be able to design large-scale stuff that doesn't stink of poor design. Out of the 3 options, Ruby has a lot to show you here. So does Scala.

All the languages can do CS stuff, so I don't see how a language will be a detriment. Sure, one language may be more elegant than another, but people used to express CS-level stuff in C and C++ back in the day, so really, you can't go wrong if you're just trying to learn concept and not becoming fluid with a language.

Once you know a set of concepts, it's much easier to understand any language that uses those concepts.

Upvotes: 1

Related Questions