December 13th, 2002, 05:13 PM
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.
December 17th, 2002, 12:12 AM
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).
December 17th, 2002, 05:01 PM
December 18th, 2002, 03:48 AM
I've made the plunge and "Learning Python" - O’Reilly arrived on my doorstep yesterday
- Thanks for your posts.
December 19th, 2002, 11:06 PM
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?
December 19th, 2002, 11:44 PM
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.