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.

🌐
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 - The most popular Python framework is Django, but you may well come across others [2]. Django was released in 2005 and made Python highly competitive with Ruby and the Ruby on Rails framework. Learn more about why the Django framework is so popular today in this lecture by Professor Charles Severance from the University of Michigan's Django for Everybody Specialization: Python is used to write scripts for automating workflows.
Discussions

Ruby vs Python: Which is better suited for scripting utilities on Windows? And why? - Stack Overflow
I need to write a bunch of scripts to grab diagnostic data from customer environments where our product is installed. Troubleshooting data I need comes various sources including Oracle database, More on stackoverflow.com
🌐 stackoverflow.com
November 10, 2011
What does Ruby have that Python doesn't, and vice versa? - Stack Overflow
Ruby has first class regexps, $-variables, the awk/perl line by line input loop and other features that make it more suited to writing small shell scripts that munge text files or act as glue code for other programs. Thanks to the callcc statement. In Python you can create continuations by ... More on stackoverflow.com
🌐 stackoverflow.com
Ruby vs Python

Python is more popular in when it comes to scientific computing and big data analysis. Ruby (I believe) is more popular when it comes to web development.

The major difference come down to programming philosophy imho. Ruby is more about expressiveness and flexibility while Python emphasizes correctness and consistency.

More on reddit.com
🌐 r/ruby
42
34
November 9, 2016
Ask HN: Why Python over Ruby?
I don't want a flame war or religious arguments. I would like to understand what made Python win in this space. Thanks so much for commenting · Ruby has method aliases. Python does not allow a string to capitalize itself More on news.ycombinator.com
🌐 news.ycombinator.com
196
87
July 14, 2009
🌐
GeeksforGeeks
geeksforgeeks.org › python-vs-ruby
Python vs Ruby - GeeksforGeeks
September 3, 2024 - They both are server-side scripting languages. Both are used for web applications. Both work on multiple platforms. Both have clean syntax and are easily readable. Both use an interactive prompt called IRB. Objects are strongly and dynamically typed. Both use embedded doc tools. A GNU Debugger(gdb) style is available for each language. Both languages are supported by Emacs modes. Here are the following difference between Python and Ruby:
🌐
Quora
quora.com › Ruby-vs-Python-Which-language-would-be-better-and-more-powerful-for-general-programming-and-some-web-development
Ruby vs. Python: Which language would be better and more powerful for general programming and some web development? - Quora
Answer (1 of 9): Common points 1. Dynamically typed language. 2. Interpreted language. 3. Almost same speed of runtime. 4. Open source. Both are suitable for web development and general purpose programming, but there are few concerns. Python Advantages * Python is used in different in do...
🌐
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. It’s main goal is to make everything obvious to the programmer.
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!"    
Find elsewhere
🌐
Devox Software
devoxsoftware.com › blog › python-vs-ruby-which-to-choose
Ruby on Rails vs Python: Everything You Need to Know
October 13, 2025 - To start, Python and Ruby are next-gen, supreme-level, server-side scripting languages concentrating on simpler, crispier, and high-performance codes. Python was created organically in the scientific community as a prototyping language, the aim of which was the ability to readily be translated into C++ if a prototype worked. Python envisages a straightforward strategy for programming.
🌐
Reddit
reddit.com › r/ruby › ruby vs python
r/ruby on Reddit: Ruby vs Python
November 9, 2016 -

I am a CS student and we have just begun studying OOP in Ruby this semester. I have had quite minimal usage of Python over the past year.

I love Ruby. I find it very refreshing to write and read compared to C, C++, Java etc. (although I do still thoroughly enjoy these languages). With my lack of experience in both Ruby and Python, I see them as two very similar languages - a program/script written in one could be translated into the other very easily. However, for some reason I find myself preferring Ruby over Python. It just comes across as the most user-friendly language I have written in so far.

Why does it seem that so many more people write in Python compared to Ruby? Does Python offer better performance? I'd imagine that Python has a more vast collection of libraries to offer, but this, again, would mainly be down to the fact that it is more commonly used.

Is there any reason why I couldn't just forget about Python and focus on Ruby instead of it? Are there any concrete examples where a program would be better suited to Python than Ruby, or vice versa? I know that languages are just tools to solve problems with, but it is easy to choose when to write a program in Python over Java, for example. Yet, I can't say the same for Ruby vs Python.

Top answer
1 of 5
31

Python is more popular in when it comes to scientific computing and big data analysis. Ruby (I believe) is more popular when it comes to web development.

The major difference come down to programming philosophy imho. Ruby is more about expressiveness and flexibility while Python emphasizes correctness and consistency.

2 of 5
18

Python and Ruby are both very mature languages with good standard libraries and a huge collection of supporting libraries ("gems" in Ruby parlance). I wouldn't say one has "more" developers than the other, but due to the libraries and communities that have developed around them, you will find their popularity varies in different circles.

In the web development world, Ruby reigns supreme. Projects like Ruby on Rails, Sinatra, and Jekyll are still going strong. Chef, which is used for configuring and managing servers, is Ruby (although you can deploy any kind of server with it, not just Ruby/Rails ones).

I also use Ruby for day-to-day shell scripting as a much nicer alternative to bash.

Python is (was?) huge at Google, and is also very popular within scientific communities due to the good support of mathematical libraries like NumPy, matplotlib, and others (I know much less in this area). Python also has a web framework, Django, which is moderately popular and follows in the footsteps of Rails.

In the end, since you're just learning OOP concepts, either will work totally fine. If you like Ruby, then go for it. You'll be able to transfer the knowledge to other OOP languages quite easily. Ruby also leans heavily on functional concepts, which will aid you when you inevitably pick up functional languages.

🌐
Guru99
guru99.com › home › python › python vs ruby – difference between them
Python vs Ruby – Difference Between Them
August 12, 2024 - It can be used for the development of Internet and intranet applications. Ruby has a rich set of built-in functions, which can be used directly in Ruby scripts. Here are the pros/benefits of using Ruby from my experience: Offers freedom to developers to apply creative solutions · Ruby has a clean and easy syntax, which allows a new developer to learn very quickly and easily. Just like Python, it’s open source.
🌐
UpGuard
upguard.com › blog › python-vs-ruby
Ruby vs Python: Comparing Languages | UpGuard
January 9, 2025 - It has some unique tricks all its own: speed and a super large ecosystem. There is a perception that Python is faster than Ruby, and this has often led teams to prefer it over Ruby for web development.
🌐
Hacker News
news.ycombinator.com › item
Ask HN: Why Python over Ruby? | Hacker News
July 14, 2009 - I don't want a flame war or religious arguments. I would like to understand what made Python win in this space. Thanks so much for commenting · Ruby has method aliases. Python does not allow a string to capitalize itself
🌐
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...
🌐
GitHub
github.com › mjhea0 › python-ruby
GitHub - mjhea0/python-ruby: Should I Learn Python or Ruby? · GitHub
It's advisable to write Ruby code, when beginning, in a more Pythonic way - which simply means making it more readable: def fib(n) if n < 2 n else fib(n-1) + fib(n-2) end end · Keep in mind that in many cases with Python there are still a number of ways to do one thing. Take copying a list for example.
Starred by 322 users
Forked by 32 users
Languages   Python 56.6% | Ruby 43.4%
🌐
Batsov
batsov.com › articles › 2011 › 05 › 03 › ruby-or-python
Ruby or Python? | (think)
May 2, 2011 - Both languages have support for “top-level” functions - that live (or seem to live) outside classes and modules (something not possible in Java for instance). This makes them good for general purpose scripting. While I would still prefer to do my system administration with shell and Perl scripts - Ruby and Python offer a solid alternative.
🌐
RailsCarma
railscarma.com › home › ruby vs python, the scripting wizards
Ruby vs Python, the Scripting Wizards - RailsCarma - Ruby on Rails Development Company specializing in Offshore Development
January 10, 2024 - Being a Rubyist, the reason I love Ruby for, is its Simplicity. It gives me the space to code in a manner I choose, by giving me ample of options to choose from. In short, it’s developer-friendly and easy to pick up and fun to learn. ... Python is all about Efficiency and Support for applications that require heavy calculations, which are the basic needs for any application that has to do with Data and Science.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › top differences tutorial › python vs ruby
Python vs Ruby | Top 6 Beneficial Differences You Should Know
May 6, 2023 - These are widely used for developing web apps and prototypes, thanks to their standard libraries, persistence support, and feature-packed frameworks—Python’s Django framework and Ruby’s Ruby on Rails. Python and Ruby have interpreted scripting languages, unlike Java, C++, and other compiled ...
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Learn Enough
learnenough.com › blog › ruby-vs-python
Ruby vs Python: What’s The Difference & How To Choose?
January 12, 2024 - That’s precisely the problem with Python and Ruby. Both languages have their enchantments and quirks, their dedicated followers and critics. One is hailed for its versatility, almost like a multitool in a coder’s toolkit.
🌐
Turing
turing.com › blog › ruby-vs-python-what-is-the-difference
Ruby vs. Python: What Is the Difference? | Turing
February 21, 2025 - Both are high-level scripting languages, so their programs do not need compiling. Since the objects in both languages are strongly and dynamically typed, you do not have to declare variables firsthand.
🌐
Efigence
efigence.com › home › differences between python and ruby
Ruby vs Python: Differences, similarities, performance
September 3, 2024 - Although they have much in common, they differ from each other in terms of their history, syntax, semantics, features, and performance. However, both are quite easy to learn and efficaciously used in ...