I'm currently working on a python web project; the lack of a mature, battle-hardened payment library kills me.
Ruby's ActiveMerchant is a well-crafted bit of code. The handful of python contenders I've discovered are (1) immature and often poorly coded, and (2) unable to touch ActiveMerchant in terms of number of supported gateways and features supported per gateway.
I'd agree. One of my big laments as a ruby developer is that the minute you step outside web development, pythons libraries kick the crap out of rubys, in comprehensiveness and maturity. See nltk and scipy.
Even from a systems perspective there are more tools available in Python. Pyroute2 vs netlinkrb which was last updated 8 years ago and only does a few things. It’s sad because ruby had the potential, but ruby developers prefer to focus on the Rails ecosystem.
Ruby is incredibly flexible, whereas Python is not. Often times my idea of the way things should be done is not Guido's idea, and so Python seems a bit lacking.
I really enjoy the pretty simply object model, the message passing OO, and blocks.
An interesting point that I read somewhere the other day, from someone who codes in a lot of both: Ruby (to him) is kind of ugly, and Python is very pretty. Yet, the exact parts that make Ruby ugly allow it to have _awesome_ libraries. Python, with its rigidity, means that the core language is great, but the libraries end up being worse because of it. He uses RSpec as an example, specifically. So for him, Ruby ends up being better to use, even though he likes the Python language better.
Ruby is way more capable and expressive than Python. There is so much more you can do with Ruby metaprogramming and don't get me started on Python's feeble lambdas which bear the mark of a BDL imposing his distaste for functional programming. Python is the VHS of programming - widely adopted but technically inferior. Ruby appeals to devs who value elegance of design. Take Sonic Pi (https://sonic-pi.net), for example - I can't imagine sam Aaron producing anything like this in Python. The DSL is everything in this app as with Rails.
Yes, one of the biggest drawbacks in the Ruby world is the lack of strong libraries outside of web dev. Python has scrapy, numpy, pandas, nltk, beautifulsoup, matplotlib, etc. Basically if you want to do almost anything (except high performance real time stuff) you can do it in python. it is an excellent general purpose language.
In ruby, the world isn't so great. When I was in the ruby world, I would always hit roadblocks on my side projects. There were so many times where I wanted to do something not web dev related and I couldn't find a popular and well supported ruby package. For example, I wanted to do text analysis of some sites I scraped and python's nltk was perfect (but there wasn't a perfect ruby library).
The ruby world needs to expand beyond web dev if it wants to grow.
I think this could be summed up as a) python venvs can be very annoying, and are a weakness of python, and b) rails + active record is a strength for ruby. Fully agree with both, but disagree with the hyperbole (worst possible choice vs. best possible choice). FWIW I haven't even seen Python 2 code in about 6 years.
Python improvements are on par with ruby, and ruby has a JIT, which means that upside fir real world improvement is much higher.
Python has no static typing. It has type annotations, which a few 3rd party static analysers such as mypy use. Ruby has had the same since 3.0 with rbs. The ecosystem may be less mature, but it exists, and Python's isn't necessarily perfect.
Python async is terrible. You have to colorize functions, opt out from a significant part of the ecosystem which either does not support async, or is very unstable, and completely relearn how to do debugging / performance measurement. Ruby has smth better since ruby 3.0, via the fiber scheduler, which supports running network related code asynchronously with *no changes or special function annotations*.
Ruby packaging has been figured out since 2007, and has been influencial for other ecosystems, being the first mainstream language adopting lockfiles.
If you prefer using Python, you are entitled to your opinion and choice. But those arguments are all FUD.
I rarely find an area where I've needed libraries and there haven't been decent stuff available in Ruby other than when doing quite esotheric stuff (e.g. there's no good low level X11 client implementation for doing raw X11 stuff). Often multiple competing projects.
E.g. for ORMs ActiveRecord which is Rails default is in my opinions nowhere near good enough compared to e.g. Sequel, and there are several others.
Sometimes those projects involve wrapping stuff - including Python - or porting Python, but most of what I use is pure Ruby.
With respect to Python, to a lot of the Ruby community Python is in many ways the antithesis of what we want in a language. Python looks horrendous to me. It matters - I stare at code most of my day. If I were to switch languages, Python wouldn't make the shortlist even. It's not that I think Python is objectively worse, but subjectively to me it's unreadable and messy and I can afford to avoid using it most of the time.
Playing devils advocate here, but Ruby's ticked those boxes pretty well in my experience. Also js if you don't mind sacrificing a bit of expressiveness (pseudocode-ish syntax).
Don't get me wrong, I do also love python and can see it being used for years to come. Also, I know of at least a couple of algorithmic traders using it daily.
That looks really interesting...but what's with all the ruby-only stuff? I haven't seen enough of a reason to move from python to ruby, and they both seem like appropriate technologies for something like this.
Python is far more mature, isn't a strange ad-hoc combination of other languages, has a third-party library to do anything and everything (which is probably also reasonably mature), and doesn't have a community rife with arrogant children.
I'm generalizing to some extent, of course, but these are the things that I and other developers I know associate with Ruby (including many who's startups are built on it). I imagine as the language and community grow and mature they will shed these associations and hopefully create a language worth taking seriously. They haven't done that yet (strictly in my opinion).
Ruby's ActiveMerchant is a well-crafted bit of code. The handful of python contenders I've discovered are (1) immature and often poorly coded, and (2) unable to touch ActiveMerchant in terms of number of supported gateways and features supported per gateway.
reply