Ruby delivers on the promise of being "optimized for programmer happiness." But I think that in order to experience that you have to become fairly immersed. In fact, some of the best parts seem outright offensive at first (question marks in method names?!). No language is perfect. But once you get past the idiosyncrasies, I honestly do think Ruby feels better. That's pretty esoteric, so I'll try to call out some specifics as well. I agree with most of what's already been said, but I'll try to add a few things. In order of most to least significance (for me): The standard library, especially with regard to collection methods. Want to slice/filter/sort/chunk an array/hash in some weird way? Ruby's standard library almost certainly supports it. So many amazing things are built-in across the board. Not relying on indentation for scoping. It's one of my biggest beefs with Python. Yes, of course, code should be indented properly. But goodness....let my linter enforce that, not the interpreter. I don't love ruby's do/end keywords (I prefer curly-braces), but at least having a visual cue for end-block is a vast improvement over python. A more consistent interface. Everything is an object, and you invoke methods on those objects. I think [].size just makes more intuitive sense than len([]). Great readability boosts from things like question-marks or exclamation-points in method names (admittedly that felt gross and wrong at first), trailing if-statements, unless-conditionals, invoking methods without parens (though I only sanction this if not passing args). A more helpful, less snobby community. 100% just my personal experience, maybe I've just had bad luck with pythonistas. No __init__.py nonsense. Maybe that's fixed/improved in python3? But I hate it. In fact, I hate any use of dunders...littering the code with unreadable symbols. Answer from human_tendencies on reddit.com
🌐
Ruby-Doc.org
ruby-doc.org › home › ruby vs python – a comprehensive comparison for developers
Ruby vs Python - A Comprehensive Comparison for Developers - Ruby-Doc.org
July 11, 2025 - The Ruby 3.x series focused on ... performance for computational tasks, while Ruby is optimized for developer productivity and fast iteration cycles in web applications....
🌐
Reddit
reddit.com › r/ruby › benefits of moving from python to ruby?
r/ruby on Reddit: Benefits of moving from Python to Ruby?
May 31, 2022 -

Question from someone who invested much time in Python. What benefits Ruby has to convince to move? Instead continue with Python?

Top answer
1 of 13
34

When it comes to scripting languages, the objective differences are very nuanced. Largely, it depends on what you want to do. Python, for example, is extremely popular in the data sciences. A complementary example for Ruby would be rapid application development with Ruby on Rails, a web framework that allows you to build web applications very quickly. Another example would be building an API using Ruby's Sinatra library. Python also has web frameworks, so it's not as if Ruby has an exclusive claim to this benefit, but many developers find tools like Ruby on Rails and Sinatra very satisfying and beneficial to work with.

My recommendation would be to give Ruby an honest shot. Don't make the mistake of simply trying to write Python code using Ruby. Really dig in to what makes Ruby, Ruby. If you enjoy it, then you've added another language to your tool belt. If you don't, you might walk away with some ideas about development that you can apply to Python.

2 of 13
27

Ruby delivers on the promise of being "optimized for programmer happiness." But I think that in order to experience that you have to become fairly immersed. In fact, some of the best parts seem outright offensive at first (question marks in method names?!). No language is perfect. But once you get past the idiosyncrasies, I honestly do think Ruby feels better. That's pretty esoteric, so I'll try to call out some specifics as well.

I agree with most of what's already been said, but I'll try to add a few things. In order of most to least significance (for me):

The standard library, especially with regard to collection methods. Want to slice/filter/sort/chunk an array/hash in some weird way? Ruby's standard library almost certainly supports it. So many amazing things are built-in across the board.

Not relying on indentation for scoping. It's one of my biggest beefs with Python. Yes, of course, code should be indented properly. But goodness....let my linter enforce that, not the interpreter. I don't love ruby's do/end keywords (I prefer curly-braces), but at least having a visual cue for end-block is a vast improvement over python.

A more consistent interface. Everything is an object, and you invoke methods on those objects. I think [].size just makes more intuitive sense than len([]).

Great readability boosts from things like question-marks or exclamation-points in method names (admittedly that felt gross and wrong at first), trailing if-statements, unless-conditionals, invoking methods without parens (though I only sanction this if not passing args).

A more helpful, less snobby community. 100% just my personal experience, maybe I've just had bad luck with pythonistas.

No __init__.py nonsense. Maybe that's fixed/improved in python3? But I hate it. In fact, I hate any use of dunders...littering the code with unreadable symbols.

Discussions

What does Ruby have that Python doesn't, and vice versa? - Stack Overflow
To use an example you brought up, ... as readable or idiomatic as in Ruby. So in Python, a good programmer will want to take a different route to solving the problem than he would in Ruby, just because it actually is the better way to do it.... More on stackoverflow.com
🌐 stackoverflow.com
Ruby vs. Python comes down to the for loop

Your python example is unnecessarily complicated. You can achieve the exact same thing just as simple as you would in your Ruby example. Perhaps you are not aware of the existence of "yield" in python?

class Stuff:
    def __init__(self):
        self.a_list = [1, 2, 3, 4]

    def __iter__(self):
        for val in self.a_list:
            yield val
More on reddit.com
🌐 r/programming
4
0
April 22, 2024
Python vs Ruby! Which is easier?

Having used both, I'd say Ruby, especially if you're already an experienced programmer who's more used to C syntax. Python feels restrictive to me, Ruby has powers that reveal themselves as you learn more. But neither are my preferred language.

More on reddit.com
🌐 r/ProgrammerHumor
15
0
October 24, 2022
Ruby vs Python vs Go
Why not write a small program in each of the languages? That way you can see how they are all different when solving the same problem. This will help you form opinions on what parts of each language you like or dislike. If you're going to be choosing a career based on a specific language, it's probably good you enjoy using that language. More on reddit.com
🌐 r/learnprogramming
5
1
October 18, 2022
People also ask

Can you use Ruby and Python together?
Yes! It is certainly possible to use Ruby and Python together. If you’d like to know more about how Ruby and Python can work together, you can look at this article. It even includes an example!
🌐
hackr.io
hackr.io › home › articles › programming
Ruby vs Python: Differences You Should Know [Updated] 2026
Which is easier, Ruby or Python?
If you’re a beginner looking to learn either of the two languages, you may be wondering which one would be easier to start with. One of the best ways to figure out which one would be easier is to look at Ruby vs Python syntax. Purely based on syntax, Python wins — simply because it uses simpler, more natural language.
🌐
hackr.io
hackr.io › home › articles › programming
Ruby vs Python: Differences You Should Know [Updated] 2026
Which is more popular, Ruby or Python?
When it comes to use in web development, Ruby is generally much more popular. Python tends to be more popular for use in academic and scientific circles and purposes.
🌐
hackr.io
hackr.io › home › articles › programming
Ruby vs Python: Differences You Should Know [Updated] 2026
🌐
UpGuard
upguard.com › blog › python-vs-ruby
Ruby vs Python: Comparing Languages | UpGuard
January 9, 2025 - Despite the noisy arguments from both languages’ camps, it is impossible to say whether one language is overall ‘better’ than the other. It’s clear that each has some areas it is better suited to, because of its features and support from other users in the same area. For Ruby this is web development via the Rails framework, and for Python it is scientific and academic programming.
🌐
One Month
learn.onemonth.com › home › ruby vs. python: what’s the difference?
Ruby vs. Python: What's the Difference? - Learn to code in 30 Days!
September 30, 2022 - Ruby is designed to be infinitely flexible and empowering for programmers. It allows Ruby on Rails to do lots of little tricks to make an elegant web framework. This can feel even magical at times, but the flexibility can also cause some problems. For example, the same magic that makes Ruby work when you don’t expect it to can also make it very hard to track down bugs, resulting in hours of combing through code. Python takes a more direct approach to programming.
🌐
Hackr
hackr.io › home › articles › programming
Ruby vs Python: Differences You Should Know [Updated] 2026
January 30, 2025 - Ruby supports single inheritance while Python supports multiple inheritance · Ruby tends to be used more for functional programming and web development (thanks to Rails), while Python is a language geared more toward AI, academic, data science, ...
🌐
Coursera
coursera.org › coursera articles › computer science and engineering › web and app development › ruby vs. python: which should you choose?
Ruby vs. Python: Which Should You Choose? | Coursera
February 7, 2026 - Ruby, which uses the Ruby on Rails framework, may be better for rapid development and commercial web applications. Python, which employs the Django framework and is often used in data science, AI, and finance, is versatile and ideal for beginners.
Find elsewhere
Top answer
1 of 16
34

Ruby has the concepts of blocks, which are essentially syntactic sugar around a section of code; they are a way to create closures and pass them to another method which may or may not use the block. A block can be invoked later on through a yield statement.

For example, a simple definition of an each method on Array might be something like:

class Array
  def each
    for i in self  
      yield(i)     # If a block has been passed, control will be passed here.
    end  
  end  
end  

Then you can invoke this like so:

# Add five to each element.
[1, 2, 3, 4].each{ |e| puts e + 5 }
> [6, 7, 8, 9]

Python has anonymous functions/closures/lambdas, but it doesn't quite have blocks since it's missing some of the useful syntactic sugar. However, there's at least one way to get it in an ad-hoc fashion. See, for example, here.

2 of 16
28

Python Example

Functions are first-class variables in Python. You can declare a function, pass it around as an object, and overwrite it:

def func(): print "hello"
def another_func(f): f()
another_func(func)

def func2(): print "goodbye"
func = func2

This is a fundamental feature of modern scripting languages. JavaScript and Lua do this, too. Ruby doesn't treat functions this way; naming a function calls it.

Of course, there are ways to do these things in Ruby, but they're not first-class operations. For example, you can wrap a function with Proc.new to treat it as a variable--but then it's no longer a function; it's an object with a "call" method.

Ruby's functions aren't first-class objects

Ruby functions aren't first-class objects. Functions must be wrapped in an object to pass them around; the resulting object can't be treated like a function. Functions can't be assigned in a first-class manner; instead, a function in its container object must be called to modify them.

def func; p "Hello" end
def another_func(f); method(f)[] end
another_func(:func)      # => "Hello"

def func2; print "Goodbye!"
self.class.send(:define_method, :func, method(:func2))
func                     # => "Goodbye!"

method(:func).owner      # => Object
func                     # => "Goodbye!"
self.func                # => "Goodbye!"    
🌐
GeeksforGeeks
geeksforgeeks.org › python-vs-ruby
Python vs Ruby - GeeksforGeeks
September 3, 2024 - Ruby is a dynamic programming language due to which there is no tough rules on how to built in features and it is very close to spoken languages. Python is a simple, easy-to-learn, powerful, high level and object-oriented programming language.
🌐
Batsov
batsov.com › articles › 2025 › 09 › 12 › why-i-chose-ruby-over-python
Why I Chose Ruby over Python | (think)
September 16, 2025 - I’m not trying to convince anyone that Ruby’s a better language than Python, I’m just sharing the story of how I ended up in team Ruby almost 20 years ago. Back in the day I felt that Ruby’s syntax was more elegant and more consistent than Python’s, and today my sentiment is more or less the same.
🌐
Guru99
guru99.com › home › python › python vs ruby – difference between them
Python vs Ruby – Difference Between Them
August 12, 2024 - Python supports multiple inheritance, while Ruby supports single inheritance. Python is mainly used for academic, AI, machine learning, and scientific programming, while Ruby is used for web development and functional programming.
🌐
GitHub
github.com › mjhea0 › python-ruby
GitHub - mjhea0/python-ruby: Should I Learn Python or Ruby? · GitHub
Performance is a toss up as well. In some cases Python performs better, while in others Ruby outperforms Python. It all depends on the task at hand. Ruby has a bigger web presence with Rails than Python does with Django, so if you're looking ...
Starred by 322 users
Forked by 32 users
Languages   Python 56.6% | Ruby 43.4%
🌐
Turing
turing.com › blog › ruby-vs-python-what-is-the-difference
Ruby vs. Python: What Is the Difference? | Turing
February 21, 2025 - They are also popular choices for web development employed in other fields. This parallelism has given rise to the popular debate of Ruby vs. Python. Yet, when it comes to helping scale-up businesses, Python is preferred. Everything Ruby can do, Python can do better.
🌐
Nascenia
nascenia.com › ruby on rails, mobile and web applications outsourcing expert | nascenia › why choose ruby on rails over python in web development?
Why Ruby is Better than Python? | Ruby vs Python | Nascenia
March 4, 2025 - Ruby is believed to be more elegant, and expressive whereas Python prefers to be conservative and stable. Ruby is designed to be infinitely flexible and empowering for programmers · It has an elegant web framework and happens to be more magical ...
🌐
Quora
quora.com › Is-Ruby-a-better-designed-programming-language-than-Python-good-balance-of-OOP-functional-programming-capabilities-syntax-and-semantics-etc
Is Ruby a better designed programming language than Python (good balance of OOP/functional programming capabilities, syntax and semantics, etc.)? - Quora
Answer (1 of 4): I’m not super experienced with Ruby, so take what I say with a grain of salt, but I would say they have different strengths in terms of design—though I would say overall, I prefer the design of Ruby. The main strength of Ruby is that it is more true to the ideals of object ...
🌐
Stackify
stackify.com › ruby-vs-python
Comparison: Ruby vs. Python - Stackify
April 11, 2024 - Also worth mentioning is SciPy, which has resources to solve math functions that used to make engineering students sweat. In this aspect, Ruby has inherited Perl’s philosophy: “There’s more than one way to do it.” So, you will always find many different methods to achieve a task in Ruby. Depending on who’s writing the code, this might lead to unnecessary complexity and obfuscation. On the other hand, Python follows an approach where simplicity has more value than complexity (see “The Zen of Python“).
🌐
JayDevs
jaydevs.com › ruby-vs-python
Ruby vs. Python: Which Language Will Power Your Project in 2024? - JD
November 11, 2025 - Let's Talk · It depends on the project’s specifics. Ruby is better for web projects requiring fast time to market, while Python is versatile and widely used in data science, machine learning, and web development.
🌐
StxNext
stxnext.com › home › blog › python vs. ruby: a comparison of differences and similarities
Python vs. Ruby: A Comparison of Differences and Similarities
April 10, 2025 - There is often more than one way of doing things in Ruby, all with the user’s convenience in mind. However, this very fact not only allows for unconventional solutions, but also means that any errors can be difficult to detect and debug. Python, on the other hand, is all about readability and visibility. Per The Zen of Python: “Explicit is better than implicit.
🌐
Medium
nmingotti.medium.com › ruby-is-better-than-python-for-unix-like-system-administration-e520ef41e66d
Ruby is better than Python for Unix-like system administration | by Dr. Nicola Mingotti | Medium
February 26, 2024 - Python is a very good general purpose scripting language, especially for scientist and non programmers but we are going to show here Ruby is hands down superior as a Unix scripting language and power tool.
🌐
Imaginary Cloud
imaginarycloud.com › blog › ruby-vs-python-for-web-development
Ruby vs Python: differences in web development
If you just want to stick with web development Ruby is your best choice. But if you have in mind to add other features to your web application, like machine learning or other computer science areas, Python is the most suitable as it has libraries ...