Ruby vs Python: 10 Questions to Ask Before You Choose

Boot.dev Blog » Python » Ruby vs Python: 10 Questions to Ask Before You Choose
Zulie Rane
Zulie Rane

Last published October 25, 2021

Subscribe to curated backend podcasts, videos and articles. All free.

A ruby is a beautiful red gemstone; a python is a beautiful green snake. Aside from that, they’re both very popular programming languages. They’re popular for different reasons, and they’re good at different things. Before you choose between Ruby vs. Python, make sure you ask yourself these 10 questions.

While I’m more familiar with Python since I use it for web scraping and data cleaning, Ruby is also worth a mention. When I was first deciding which coding language would be best to learn, I spent some time debating between Ruby vs Python. Ultimately I landed on Python, but that doesn’t mean Ruby isn’t for you.

First, some background information. The first thing you should know is that both languages open source. This is great news for you, because it means you’ll be able to learn and use them for free without needing to pay. They’re both high-level scripting languages. This means that their programs don’t need to be compiled. They are both dynamically typed, so you don’t need to declare a variable before you use one. But that’s mostly where the similarities end.

Ruby is most commonly used to create web applications. Especially with its most popular framework, Ruby on Rails. With Rails, you can quickly create business processes and web apps using modules and code snippets instead of starting completely from scratch. Python tends to be used more generally - you can use it for web apps, but you can also use it for data cleaning and prep, doing statistical work, or data visualization.

That should give you enough context to help you understand the basics of the Ruby vs Python discussion, and understand which is best for you in these ten different respects below.

Which is most popular? Python
Which is best for beginners? Python
Which performs best? Both are equal
Which is best for web development? Ruby
Which is best for your career? Depends
Which is best for Artificial Intelligence/Machine Learning/Deep Learning? Python
Which is best for productivity? Both, depending on personal philosophy
Which is more readable? Python
Which is more innovative? Ruby
Which language will be best for the future? Python (with caveats)

Both Ruby and Python are much-loved languages among the developer Community. But there’s no question about which is more popular - it’s Python. Looking at the 2020 StackOverflow developer survey, you can see that Python traded places with SQL to become the third most popular language for developers. You have to scroll down quite a way to see Ruby, which comes in at a lowly 17.

Ruby was definitely more popular a couple of years ago, but in the developer community, languages often go through popularity cycles.

It’s not just among enthusiasts where Python is more popular. If you want to get a job, remote jobs at StackOverflow show 5x as many results when you search for Python vs. Ruby.

2. Ruby vs Python: Which is best for beginners? 🔗

If you’re a novice coder like me, there’s no question when choosing which is best for beginners: it’s Python. When looking at Ruby vs Python for syntax, Python’s syntax is super clear to read and write, very similar to English. This is what makes it really good for beginners to pick up and start getting to grips with the coding concepts.

It’s worth pointing out that once you understand the basics of both Python and Ruby, it could be argued that Ruby is better for beginners thanks to all the built-in features available in Ruby on Rails. However, if you’re right at the start of your development career, I recommend you should go with Python.

Additionally, I might be biased, but I found the Python community to be exceptionally supportive. There were tutorials, videos, courses, Slack groups, Discord chats - all sorts of content, in other words - to help beginners pick up the new language. Pythonistas are a cool bunch.

3. Ruby vs Python: Which performs best? 🔗

No matter whether you’re a beginner or an expert coder, you’re probably wondering which language performs the best. It may not matter a lot when you’re just beginning, but when you want to do something more ambitious and work or as a hobby, the performance of a language will matter.

I really loved this post by Scout APM which, after a very thorough benchmarking attempt, concludes that when it comes between Ruby vs Python, performance as an indicator isn’t really a great reason to choose one over the other. A Python vs Ruby benchmark test won’t really tell you anything useful.

The author points out that if you’re really looking at pure language performance, you probably want a compiled language. In most business cases, solving the problem first ( AKA product-market fit) matters more than Pure Performance. For large-scale web apps, performance comes down to architecture design rather than language choice.

I agree, so I won’t pick a winner in terms of performance or benchmarking between Ruby versus python. If you have a specific task in mind, I recommend you check through the post yourself and see the various instances where Python shines over Ruby or vice versa.

4. Ruby vs Python: Which is best for web development? 🔗

This is actually a question of Ruby on Rails versus Python, or Python’s web app framework, Django.

As alluded to in the introduction of this post, Ruby’s almost certainly better for web development. The Ruby on Rails framework is specialized to build web applications. You probably actually use a lot of the applications that were built with Ruby on Rails – Basecamp, GitHub, Spotify, Airbnb, Twitch, SoundCloud, Zendesk, Square, and hundreds of other web applications are all built using Ruby on Rails. One estimate lists that there are nearly a million live websites using Ruby on Rails. The Ruby on Rails website claims that learning to build a modern web application is easier and more fun with Ruby on Rails.

That being said, Python’s web-app framework “Django” is a viable second option. While there are only thirty thousand live websites running on Django, that popularity is only growing.

So, Ruby or Python for web development? Both frameworks give you the generic functionalities to build a web application; they help you reuse code which saves you time, money, and energy - pretty much everything you value as a developer. I’d recommend using Django for the same reasons you use Python – if you’re relying on machine learning and AI for core features. If you’re expecting rapid prototyping, fast growth, and lots of changes down the road, I’d recommend Ruby on Rails.

5. Ruby vs Python: Which is best for your career? 🔗

Python vs Ruby: the jobs edition. I’d recommend Python to help you get your foot in the door as a developer. However, if you enjoy the rough and tumble of startup life later in your career, learning Ruby and Rails could be extremely valuable.

As I said above, there are definitely more options out there for people who know how to code in Python. The skills that you learn with python will also come in handy for pretty much any kind of development you have to do down the road. That’s what makes it such a great entry-level coding Language.

However, there’s a huge demand for specialized Ruby Developers. Remember how many web applications are built using Ruby on Rails? Those aren’t going to change anytime soon. And they need experienced Ruby on Rails developers to help them maintain and maybe even grow those websites. That’s not even talking about the new web apps that will be built using Ruby on Rails.

StackOverflow’s survey suggests Ruby developers may currently earn a higher salary - the average salary is around $80k, with 11-12 years of experience. Python, by comparison, earns an average salary of $61k with 9-10 years of experience. Interestingly, this may be a remnant of old trends. Current predictions looking at job postings, rather than the salary of existing developers, suggest that Python developers earn more than Ruby developers today.

6. Ruby vs Python: Which is best for Artificial Intelligence/Machine Learning/Deep Learning? 🔗

As I mentioned in the section above, Python’s strength is definitely in AI/machine learning/deep learning (all of which are kind of the same thing). There’s no particular reason why Python is better, other than the fact that there is a rich ecosystem of libraries and frameworks around AI, machine learning, and deep learning. Libraries include Scikit, NumPy, TensorFlow, Keras, and more.

Plus, new libraries are developed and shared on a regular basis. Ruby is mostly used for Ruby on Rails, whose usefulness kind of caps out at web application development.

7. Ruby vs Python: Which is best for productivity? 🔗

The nice thing about both Ruby and Python is that both have exceptional frameworks and shortcuts that I’ve been talking about this whole time. They’re built to be reusable, scalable, and help you develop good coding habits that will make you more productive down the line, no matter what language you learn.

There are some philosophical differences between them. For example, I like Python specifically because there’s really only one way to do things. If you like to be infinitely flexible, then I’d recommend Ruby for you.

I found the Ruby on Rails Doctrine really interesting to give a good perspective of who would find themselves more productive using Ruby versus Python. To get a good insight into who would be more productive using python, I loved this ancient (written in 2004, lol) almost prose poem called The Zen of Python.

Read both, decide which one you identify with more strongly, and there’s your answer of which is more productive between Ruby and Python.

8. Ruby vs Python: Which is more readable? 🔗

Should you choose the Ruby programming language vs Python for readability? This is another easy one - Python is found universally to have simpler syntax than Ruby. For some people, it can actually be kind of annoying because it’s so strict when it comes to code indentation and white space. That being said, its readability is part of what’s driven its huge adoption in popularity especially in the data science field.

However, it’s not like Ruby is dense and difficult to read. It produces elegant and readable code, and allows for developers to retain their originality and creativity when it comes to writing code. This is because Ruby offers multiple solutions to the same problem, unlike python. I find this makes it slightly less readable than Python, but it’s not as bad as something like Perl.

9. Ruby vs Python: Which is more innovative? 🔗

Ruby coders love to tout Ruby’s development model of “move fast and break things.” This means it’s likely more innovative than Python, or at least used in more modern projects. Python has had a slow, steady growth over the years.

Coding in Ruby encourages diverse and different solutions to similar problems, Rubyists often find themselves on the cutting edge of web development.

Python’s growth and development is slower, but very much present. There are new packages arriving on a regular basis, and their adoption tends to be pretty stable and universal. For example, TensorFlow was only released six years ago by Google. However, today it’s recognized and used as the de facto machine learning and AI library.

10. Ruby vs Python: Which language will be best for the future? 🔗

If I had a crystal ball, I would peer into it right now to ask this question. It’s the most important question any new coder can ask themselves: which language has the biggest potential for the future? Which language will empower me to make the best career choice in five years’ time?

Honestly, you can’t go wrong with either. Both are very promising languages with a wholesome community and lots of potential for future obligations. Python’s use cases are only growing, and it’s only becoming more popular to learn. Ruby on Rails especially makes Ruby the go-to option for web app development, which is why you use Ruby over Python both for maintaining existing web apps and creating new ones.

Both are very promising languages with a great community and lots of potential for future applications.

No matter which language you choose in the Python and Ruby comparison, you’ll be in a wonderful position to get started in your career as a developer. (And you can always consider - it doesn’t have to be Ruby or Python. Why not learn both?)

Take action and learn Python

If you’re looking to learn Python, we built our Learn Python course to take anyone from a beginner to having all the Python skills to pursue your dream Python programming job, such as in data science.

Find a problem with this article?

Report an issue on GitHub