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
🌐
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 - In the Learn to Code with Ruby Specialization, you'll explore core coding concepts like arithmetic and variables and master object-oriented programming in Ruby. In the University of Michigan's Python for Everybody Specialization, you'll learn fundamental programming concepts like data structures, networked application programming interfaces, and how to program in Python.
🌐
GitHub
github.com › mjhea0 › python-ruby
GitHub - mjhea0/python-ruby: Should I Learn Python or Ruby? · GitHub
Without a doubt, Python is much easier to learn because of how the language is structured - and how explicit it is. One can literally become proficient in two to three months. Ruby takes much longer to learn due to its flexibility.
Starred by 324 users
Forked by 32 users
Languages   Python 56.6% | Ruby 43.4%
Discussions

Benefits of moving from Python to Ruby?

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.

More on reddit.com
🌐 r/ruby
40
32
May 31, 2022
Should I learn Ruby or Python?

Unix text processing (instead of awk, sed, Perl)

You've named the kings of that domain, ruby and python both have text processing/regexp facilities but they are nowhere near as fast. I like ruby's regexp implementation a little better than python's. (go figure, says the guy on the ruby subreddit)

Web development

Ruby has some pretty bitchin web frameworks, though django and flask do a lot of the same things. The only thing that might edge ruby out as a clear winner here is that rails has so much community support, so if you don't want to re-invent the wheel, you can use a gem, whereas python might not have the same level of community support for django. It's probably pretty close.

Programs for Unix open source projects

Python is probably viewed as more of a "systems language" now than ruby. Both are equally capable of being scripting languages used for everyday tasks, just depends on what you're wanting to do.

Mobile Dev (not as much important as the first three items).

Ruboto/Rubymotion/Mobiruby are all things. I think ruby might actually take this the most handily.

tl;dr Learn multiple languages, use the tools that make sense for the project. Don't be bound to a single language.

More on reddit.com
🌐 r/ruby
40
14
September 9, 2017
Learning Python from Ruby; Differences and Similarities - Stack Overflow
You may edit the question if you ... or a detailed explanation of the proposed solution. If edited, the question will be reviewed and might be reopened. Closed 9 months ago. The community reviewed whether to reopen this question 9 months ago and left it closed: ... I know Ruby very well. I believe that I may need to learn Python ... More on stackoverflow.com
🌐 stackoverflow.com
Should I Learn Python or Ruby?
Seriously. They are relatively equivalent · I'm a Python person and ex-Perl and ex-Tcl refugee More on news.ycombinator.com
🌐 news.ycombinator.com
73
32
February 21, 2014
People also ask

Is Ruby better than Python?
This question can set off a great debate that can easily devolve into madness. If you look at Python vs Ruby, they certainly have their similarities. However, Python is often better when it comes to educational use and for making quick apps and programs, while Ruby is usually the choice for those who want to make commercial web apps. The choice depends on your (or your project’s) needs and ultimately comes down to personal preference.
🌐
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
🌐
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 - If not, learn Python first. Keep in mind there is a difference between Python 2 and Python 3. If you’re new to coding then I’d recommend you start with the latest version — Python 3 · Anything you can do in Ruby on Rails you could also ...
🌐
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.

🌐
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. It ...
🌐
Learn Enough
learnenough.com › blog › ruby-vs-python
Ruby vs Python: What’s The Difference & How To Choose?
January 12, 2024 - Python remains the top language in demand, making it a safer bet for beginners. Ruby, while powerful, has a more niche appeal in the industry. Learn Enough offers courses tailored to 2024's industry demands.
Find elsewhere
🌐
Course Report
coursereport.com › home › advice › tips and advice › ruby vs python: choosing your first programming language
Ruby vs Python: Choosing Your First Programming Language | Course Report
March 2, 2018 - With Bloc mentor Ben Neely, we learn which language is best for beginners, which will help you land your first developer job, and what makes Ruby and Python unique.
🌐
Hackr
hackr.io › home › articles › programming
Ruby vs Python: Differences You Should Know [Updated] 2026
January 30, 2025 - 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, machine learning, and other scientific programming · Python supports one-line ...
🌐
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 has a larger and more diverse global community, especially beneficial for beginners. Known for elegant and human-readable code. Great for those coming from object-oriented backgrounds. Developers often find Ruby “fun” to write. Arguably the easiest programming language to learn.
🌐
Reddit
reddit.com › r/ruby › should i learn ruby or python?
r/ruby on Reddit: Should I learn Ruby or Python?
September 9, 2017 -

Hi I want to learn an all-purpose scripting language which I can use in:

  • Unix text processing (instead of awk, sed, Perl)

  • Web development

  • Programs for Unix open source projects

  • Mobile Dev (not as much important as the first three items).

So, Ruby or Python?

Top answer
1 of 14
40

Unix text processing (instead of awk, sed, Perl)

You've named the kings of that domain, ruby and python both have text processing/regexp facilities but they are nowhere near as fast. I like ruby's regexp implementation a little better than python's. (go figure, says the guy on the ruby subreddit)

Web development

Ruby has some pretty bitchin web frameworks, though django and flask do a lot of the same things. The only thing that might edge ruby out as a clear winner here is that rails has so much community support, so if you don't want to re-invent the wheel, you can use a gem, whereas python might not have the same level of community support for django. It's probably pretty close.

Programs for Unix open source projects

Python is probably viewed as more of a "systems language" now than ruby. Both are equally capable of being scripting languages used for everyday tasks, just depends on what you're wanting to do.

Mobile Dev (not as much important as the first three items).

Ruboto/Rubymotion/Mobiruby are all things. I think ruby might actually take this the most handily.


tl;dr Learn multiple languages, use the tools that make sense for the project. Don't be bound to a single language.

2 of 14
28

I did 8 years of scientific programming in ruby, and 3 years of professional web dev in python (yes, it's ironic). Both are great languages, and I'm more than happy to code in either language at this point. I personally think ruby is easier to use for most of the things you mentioned, and I think ruby is a more elegant language than python (I think ruby is a better language, but I do think aspects of python are better).

You really can't go wrong with either. And, as was already pointed out, use python 3.6 if you choose python (the 2 train has left the station, thank heavens).

🌐
Quora
quora.com › Which-is-better-for-a-beginner-Python-or-Ruby
Which is better for a beginner, Python or Ruby? - Quora
Answer (1 of 22): Both are great languages to start with. And the comparison usually boils down to ecosystem and tools available and what you want to do with them. I would suggest figuring that before deciding on one. The ecosystems (package management, libraries, tools) are excellent for both t...
🌐
Medium
medium.com › codex › python-vs-ruby-which-should-you-choose-a20e3354769d
Python vs. Ruby: Which Should You Choose? | by Gabriel Demes | CodeX | Medium
March 30, 2021 - In this article I will discuss some of the key differences between the popular programming languages, Python and Ruby. I will also give my opinion about which language is a better choice for new programmers looking to learn their first programming language.
🌐
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
🌐
Ruby
ruby-lang.org › en › documentation › ruby-from-other-languages › to-ruby-from-python
To Ruby From Python | Ruby
Python is another very nice general purpose programming language. Goingfrom Python to Ruby, you’ll find that there’s a little bit more syntaxto learn than wi...
🌐
Guru99
guru99.com › home › python › python vs ruby – difference between them
Python vs Ruby – Difference Between Them
August 12, 2024 - In this Python vs. Ruby tutorial, we will learn the Difference between Python and Ruby with their introduction, features, advantages & disadvantages.
🌐
BairesDev
bairesdev.com › home › blog › software development
Which Language Is Best, Python or Ruby?
Python’s active community with rich documentation and a large number of third-party libraries make it a powerful choice for scripting needs. The choice between learning Ruby or Python depends on your specific goals and preferences.
Top answer
1 of 5
156

Here are some key differences to me:

  1. Ruby has blocks; Python does not.

  2. Python has functions; Ruby does not. In Python, you can take any function or method and pass it to another function. In Ruby, everything is a method, and methods can't be directly passed. Instead, you have to wrap them in Proc's to pass them.

  3. Ruby and Python both support closures, but in different ways. In Python, you can define a function inside another function. The inner function has read access to variables from the outer function, but not write access. In Ruby, you define closures using blocks. The closures have full read and write access to variables from the outer scope.

  4. Python has list comprehensions, which are pretty expressive. For example, if you have a list of numbers, you can write

    [x*x for x in values if x > 15]
    

    to get a new list of the squares of all values greater than 15. In Ruby, you'd have to write the following:

    values.select {|v| v > 15}.map {|v| v * v}
    

    The Ruby code doesn't feel as compact. It's also not as efficient since it first converts the values array into a shorter intermediate array containing the values greater than 15. Then, it takes the intermediate array and generates a final array containing the squares of the intermediates. The intermediate array is then thrown out. So, Ruby ends up with 3 arrays in memory during the computation; Python only needs the input list and the resulting list.

    Python also supplies similar map comprehensions.

  5. Python supports tuples; Ruby doesn't. In Ruby, you have to use arrays to simulate tuples.

  6. Ruby supports switch/case statements; Python does not.

  7. Ruby supports the standard expr ? val1 : val2 ternary operator; Python does not.

  8. Ruby supports only single inheritance. If you need to mimic multiple inheritance, you can define modules and use mix-ins to pull the module methods into classes. Python supports multiple inheritance rather than module mix-ins.

  9. Python supports only single-line lambda functions. Ruby blocks, which are kind of/sort of lambda functions, can be arbitrarily big. Because of this, Ruby code is typically written in a more functional style than Python code. For example, to loop over a list in Ruby, you typically do

    collection.each do |value|
      ...
    end
    

    The block works very much like a function being passed to collection.each. If you were to do the same thing in Python, you'd have to define a named inner function and then pass that to the collection each method (if list supported this method):

    def some_operation(value):
      ...
    
    collection.each(some_operation)
    

    That doesn't flow very nicely. So, typically the following non-functional approach would be used in Python:

    for value in collection:
      ...
    
  10. Using resources in a safe way is quite different between the two languages. Here, the problem is that you want to allocate some resource (open a file, obtain a database cursor, etc), perform some arbitrary operation on it, and then close it in a safe manner even if an exception occurs.

    In Ruby, because blocks are so easy to use (see #9), you would typically code this pattern as a method that takes a block for the arbitrary operation to perform on the resource.

    In Python, passing in a function for the arbitrary action is a little clunkier since you have to write a named, inner function (see #9). Instead, Python uses a with statement for safe resource handling. See How do I correctly clean up a Python object? for more details.

2 of 5
28

I, like you, looked for inject and other functional methods when learning Python. I was disappointed to find that they weren't all there, or that Python favored an imperative approach. That said, most of the constructs are there if you look. In some cases, a library will make things nicer.

A couple of highlights for me:

  • The functional programming patterns you know from Ruby are available in Python. They just look a little different. For example, there's a map function:

      def f(x):
          return x + 1
    
      map(f, [1, 2, 3]) # => [2, 3, 4]
    

    Similarly, there is a reduce function to fold over lists, etc.

    That said, Python lacks blocks and doesn't have a streamlined syntax for chaining or composing functions. (For a nice way of doing this without blocks, check out Haskell's rich syntax.)

  • For one reason or another, the Python community seems to prefer imperative iteration for things that would, in Ruby, be done without mutation. For example, folds (i.e., inject), are often done with an imperative for loop instead of reduce:

      running_total = 0
      for n in [1, 2, 3]:
          running_total = running_total + n
    

    This isn't just a convention, it's also reinforced by the Python maintainers. For example, the Python 3 release notes explicitly favor for loops over reduce:

    Use functools.reduce() if you really need it; however, 99 percent of the time an explicit for loop is more readable.

  • List comprehensions are a terse way to express complex functional operations (similar to Haskell's list monad). These aren't available in Ruby and may help in some scenarios. For example, a brute-force one-liner to find all the palindromes in a string (assuming you have a function p() that returns true for palindromes) looks like this:

      s = 'string-with-palindromes-like-abbalabba'
      l = len(s)
      [s[x:y] for x in range(l) for y in range(x,l+1) if p(s[x:y])]
    
  • Methods in Python can be treated as context-free functions in many cases, which is something you'll have to get used to from Ruby but can be quite powerful.

In case this helps, I wrote up more thoughts here in 2011: The 'ugliness' of Python. They may need updating in light of today's focus on ML.

🌐
UpGuard
upguard.com › blog › python-vs-ruby
Ruby vs Python: Comparing Languages | UpGuard
January 9, 2025 - However, this regimented philosophy results in Python being supremely readable and easy to learn – in fact a good number of schools and colleges use Python as a teaching aid. Its syntax is very simple, there is little to remember, and it is thus great for beginners. Python also boasts extensive libraries and an OO nature, though this is not as ‘pure’ as Ruby’s and is similar to object orientation in C++. Some more features in which Python is superior to Ruby are listed below and also expanded on here.
🌐
Hacker News
news.ycombinator.com › item
Should I Learn Python or Ruby? | Hacker News
February 21, 2014 - Seriously. They are relatively equivalent · I'm a Python person and ex-Perl and ex-Tcl refugee
🌐
Turing
turing.com › blog › ruby-vs-python-what-is-the-difference
Ruby vs. Python: What Is the Difference? | Turing
February 21, 2025 - For example, Ruby is the best choice for web development and projects involving machine learning, whereas Python’s libraries offer better support. Whether it is Ruby programmers or Python developers you are looking for, Turing has got your back!