4 ms·
Why language X is better of Y makes no sense. Every language has its benefits and downsides. Python has been slighly longer around and has a bigger user communi
by Bjoern 17y ago
Why language X is better of Y makes no sense. Every language has its benefits and downsides. Python has been slighly longer around and has a bigger user community which resulted in more available library code. Ruby and Python is pretty much interchangable in the sense of features as they often steal from each other and vice versa.
Ruby
- follows TIMTOWTDI
- Mutable strings etc.
- has a greater emphasis on code generation ("meta")
- VM's are much slower than Python (there is no Psycho etc.)
- emphasizes code clearity and readabiliy (human cycles are
more important)
- Libraries are much less mature
- ...
The lists of differences could go on forever. A comparsion and "why" is difficult. I think they are too similar and the people are too polarized.
A language is a tool to solve a particular problem. In the case of Python you have higher momentum of the community and the switch from C/C++/Java to Python is often easier than to Ruby. (Wild statement of me with tests from a sample set of 2 test subjects ;) )
Probably the best characterization I can come up with is.
Python is already on this "Enterprise" trip where companies use it a lot and so forth. Ruby has some interesting companies pushing it (Twitter etc.) but is not compeletely there yet, it still has more "hacker" and "monkeypatch" feeling. Oh wait, we call that "ninjapatching" in Ruby ;)
- nailer 17y agoCode is read more than it's written - TIMTOWTDI is a double edged sword.
- knowtheory 17y agoSpeed comparisons between Ruby and Python are kind of silly. Ruby 1.9 and JRuby are (if you look at http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=yarv&lang2=python&box=1 http://shootout.alioth.debian.org/u32/benchmark.php?test=all... ) comparably fast to Python, and obviously measure up slightly better against Python3. Python is not a radically better choice in terms of speed (and hell that's true even w/ 1.8. Sure Python's faster, but we're not talking orders of magnitude here).
- deno 17y agoAlso Twitter is lately moving to Scala because of Ruby's annoyances.