Thread: Ruby or Python?

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    28
    Rep Power
    0

    Ruby or Python?


    Ruby or Python?

    I'm considering adding another language to my development tool belt and would be interested with any comments regarding the comparision of Ruby and Python; speed, features e.t.c.

    - cheers
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    14
    Well, I'm a Python zealot, so take my statements with whatever grains of salt you wish.

    That being said, here goes:

    What Python has on Ruby:
    Speed of exeuction - even in normal execution Python is faster than Ruby in most cases. Throw in things like Psyco and the speed is unmatchable (with Psyco, Python can reach half C-speed).
    Available libraries - I'm gonna go ahead and give the edge to Python here without being sure about this one. There's not many things I've looked at coding which haven't had good Python bindings.
    Support/Usage in the community - Python has a much bigger user base than Ruby, with my only evidence being the number of projects written in Python vs Ruby and the activity on the comp.lang.* mailing lists for each.
    Readable, Consistent Syntax - Yes, some people think the indentation to specify nesting levels is a mistake, but I can guarantee you that 90% of those people haven't given it a fair shot. Ruby chooses to use a mish-mash of brackets and begin..end blocks as well as other strange delimiters. In my experience Python code generally reads a lot like pseudocode when best practices are applied, the same cannot be said for Ruby.

    Where it's about a draw:
    Simplicity of language - Both Python and Ruby are relatively simple languages to learn in terms of syntax and of the languages' best practices. Development time is probably approximately the same for both for any given app.
    Power of language - both are quite powerful, and none more powerful than the next anymore, it would seem. It used to be the case that Ruby had the edge here, but I wouldn't say so with Python 2.2 and greater.

    Where Ruby wins:
    Japan - Ruby's big in Japan

    So, that's my summary of the arguments between the two. I've used Python a ton, and Ruby only a smattering (I started learning it around the same time as I learned Python and once I knew Python I didn't pursue learning Ruby much anymore).
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
    here's a link to an article comparing the two languages:
    http://www.mindview.net/Etc/FAQ.html#Ruby
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    28
    Rep Power
    0
    Originally posted by jimmy2k1
    here's a link to an article comparing the two languages:
    http://www.mindview.net/Etc/FAQ.html#Ruby
    Good link.

    I've made the plunge and "Learning Python" - O’Reilly arrived on my doorstep yesterday

    - Thanks for your posts.
  8. #5
  9. No Profile Picture
    Sojournor of Lies
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Chicago
    Posts
    15
    Rep Power
    0

    Exclamation


    Python has it's following, and in Japan ruby's popular. But I don't recall seeing jobs for either so I wonder why not go for something in demand. No disrespect intended, I think python (haven't looked at ruby) is a great language. But will it help pay the bills?
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    14
    Originally posted by yabanjin
    Python has it's following, and in Japan ruby's popular. But I don't recall seeing jobs for either so I wonder why not go for something in demand. No disrespect intended, I think python (haven't looked at ruby) is a great language. But will it help pay the bills?
    Well, it's not in nearly as much demand as Java or C/C++, of course. But, in terms of capabilities, it can do everything those languages can do, and often with more pleasing results (slower, but more stable and faster-to-market). So, for new products that aren't required to be run at C speeds, it's a sound choice.

    Perhaps one of the biggest stumbling blocks is the general practice of the software industry itself, though. It's pretty difficult (impossible?) to create a sufficiently obfuscated executable program from Python sources. Sure, you can use the py2exe "freezing" method, but basically that locks in an interpreter and the compiled bytecode with some win32 .exe magic to create its executables. Supposedly, obtaining the bytecode out of there, and subsequently, the original code .. is more or less a trivial task. "How do I obfuscate my Python sources?" is one of the most frequently asked questions on comp.lang.python and the generally accepted answer is - it'd take you more work to come up with a decent enough scheme than it would for someone to crack said scheme.
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.

IMN logo majestic logo threadwatch logo seochat tools logo