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
🌐
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.

🌐
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 - Verdict: Python generally has better performance for computational tasks, while Ruby is optimized for developer productivity and fast iteration cycles in web applications. The Ruby vs Python debate often comes down to what you’re building.
Discussions

What does Ruby have that Python doesn't, and vice versa? - Stack Overflow
There is a lot of discussions of Python vs Ruby, and I all find them completely unhelpful, because they all turn around why feature X sucks in language Y, or that claim language Y doesn't have X, 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
🌐
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. Whereas Python takes a more direct approach to programming.
🌐
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.
🌐
Devox Software
devoxsoftware.com › blog › python-vs-ruby-which-to-choose
Ruby on Rails vs Python: Everything You Need to Know
October 13, 2025 - Python envisages a straightforward strategy for programming. In Python, there is only one “finest” method to do something. Ruby concentrates on “human-language” programming.
🌐
UpGuard
upguard.com › blog › python-vs-ruby
Ruby vs Python: Comparing Languages | UpGuard
January 9, 2025 - Python abhors Ruby’s ‘many ways of doing something’ school of thought, which Ruby has in common with languages like Perl and PHP; instead Python has always stressed that there is only one best way to do something, and the language should do it that way.
🌐
Batsov
batsov.com › articles › 2025 › 09 › 12 › why-i-chose-ruby-over-python
Why I Chose Ruby over Python | (think)
September 16, 2025 - In Python one has to pass self to instance methods explicitly, which always seemed to me like an excessive level of verbosity. Also, that’s quite uncommon in other object-oriented programming languages. Many special methods have names surrounded with __, which I find both odd and not very easy to type. I get why this was chosen (to avoid naming conflicts), but I don’t like it regardless. I really like that in Ruby the return value of a method is the value of the last expression that got evaluated in the method.
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!"    
🌐
GitHub
github.com › mjhea0 › python-ruby
GitHub - mjhea0/python-ruby: Should I Learn Python or Ruby? · GitHub
Also, while Python focuses on simplicity, Ruby focuses on making the programmer happy, while this tends to be true and people can make truly beautiful programs, you can also often see messy code (especially from beginners) that can be difficult ...
Starred by 322 users
Forked by 32 users
Languages   Python 56.6% | Ruby 43.4%
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-vs-ruby
Python vs Ruby - GeeksforGeeks
July 11, 2025 - 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.
🌐
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 orien...
🌐
Hackr
hackr.io › home › articles › programming
Ruby vs Python: Differences You Should Know [Updated] 2026
January 30, 2025 - Notice the use of print as opposed to puts in Ruby, and the absence of a semicolon to end the line. In Python, white spaces are significant and indicative of a block of code.
🌐
DEV Community
dev.to › mwong068 › what-s-the-difference-ruby-vs-python-20cb
What's the difference? Ruby vs. Python - DEV Community
January 2, 2020 - When accessing items from an array or list, Ruby and Python are generally the same as denoted above. But when taking a range of items, they differ only by the symbol used. Ruby uses ... and Python :. Python's : tends to be exclusive, whereas ...
🌐
Learn Enough
learnenough.com › blog › ruby-vs-python
Ruby vs Python: What’s The Difference & How To Choose?
January 12, 2024 - Furthermore, its dedicated community continually refines and updates the language. In 2024, a rise in microservices architecture saw Ruby gaining traction due to its suitability for creating modular and scalable applications. While Python spreads its wings across diverse tech terrains and wins the day in terms of Machine Learning and
🌐
Ruby
ruby-lang.org › en › documentation › ruby-from-other-languages › to-ruby-from-python
To Ruby From Python | Ruby
There are no “new style” and “old style” classes. Just one kind. (Python 3+ doesn’t have this issue, but it isn’t fully backward compatible with Python 2.) You never directly access attributes. With Ruby, it’s all method calls.
🌐
Imaginary Cloud
imaginarycloud.com › blog › ruby-vs-python-for-web-development
Ruby vs Python: differences in web development
Ruby offers Ruby on Rails, which uses a Model-View-Controller (MVC) architecture. The MVC architecture is a convention to separate logic. While Model stands for where the data is kept and processed, View is what shows the user his interface and displays the data and Controller is where the user requests that come from the View are handled and uses the Model data to send a response. ... Python offers Django, which uses an MVC architecture with a small twist: a Model-View-Template (MVT) architecture.
🌐
Medium
medium.com › @vishalsadriya1224 › performance-comparison-ruby-vs-python-vs-go-counting-character-occurrences-e824b5918106
Performance Comparison: Ruby vs. Python vs. Go — Counting Character Occurrences | by Vishal Sadriya | Medium
January 15, 2024 - Ruby: Ruby is an interpreted language, which generally has a higher runtime compared to compiled languages. Python: Python has better runtime performance than Ruby but still falls behind Go.
🌐
Turing
turing.com › blog › ruby-vs-python-what-is-the-difference
Ruby vs. Python: What Is the Difference? | Turing
February 21, 2025 - Python, let us first understand the unique functionalities of each language and their importance in the programming world. ... Ruby, a high-level, interpreted, general-purpose language, was created by Yukihiro Matsumoto in 1995. Ruby is an object-oriented language primarily used for web applications apart from data analysis, prototyping, and more.
🌐
Simplilearn
simplilearn.com › home › resources › software development › ruby vs python: decoding the best language for coders 2024
Ruby vs Python: Decoding the Best Language for Coders 2024
July 31, 2025 - Explore the nuances of Ruby vs Python and make an informed decision. Dive into their strengths and weaknesses to find the perfect fit for your coding endeavors.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
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.