Ruby vs Python
Whitespace matters. Having to "end" everything in Ruby really sucks, especially since my code is always correctly aligned. No ternary if. Seriously, I have to type this kind of crap in Ruby all the time: In Python this would be:v = a.empty? ? a.shift : nilThis is clearly less error-prone and more readable than Ruby's.if len(a) > 0: v = a[0] a = a[1:] else: v = NoneBetter built-in methods. For example, you can simply do sum([1,2,3])in Python, whereas you would have to do[1,2,3].inject(0) { |sum, i| sum += i }in Ruby. Seriously????? Why is it called inject anyways. Ruby's authors were clearly not well at English.Faster. Because Python is so much simpler than Ruby, its VM is almost an order of magnitude faster to make up. More production ready. I read somewhere that Google is using Python. Better commenting. In Python you can do: but in Ruby you're stuck withdef getTime(): '''Returns a string timestamp in the form: 'Time hh:mm:ss' ''' ...def get_time =begin doc Returns a string timestamp in the form: 'Time hh:mm:ss' =end ...
http://www.rossbeazley.co.uk/pablo-lorenzzoni-ruby-versus-python/open-source/