🌐
GitHub
github.com › mjhea0 › python-ruby
GitHub - mjhea0/python-ruby: Should I Learn Python or Ruby? · GitHub
In other words, the Ruby example is very Ruby-ish while the Python example is very Pythonic. Can you read the Ruby code? It may be more elegant but it's a bit harder to read. Meanwhile, it's easy to follow the Python code, right? You of course can write code anyway you want. It's advisable to write Ruby code, when beginning, in a more Pythonic way ...
Starred by 322 users
Forked by 32 users
Languages   Python 56.6% | Ruby 43.4%
🌐
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.
Discussions

What does Ruby have that Python doesn't, and vice versa? - Stack Overflow
(Ruby's yield is completely different from Python's anyway -- it does not return a generator.) It wouldn't be meaningful to write for format in respond_to(). The respond_to method doesn't return anything meaningful -- it simply responds to the current HTTP request. The do in respond_to do is the beginning ... More on stackoverflow.com
🌐 stackoverflow.com
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 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
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
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 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
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
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-vs-ruby
Python vs Ruby - GeeksforGeeks
July 11, 2025 - Python is knowned for its readability and versatility, making it a favorite for a wide range of applications from web development to data science. Ruby, on the other hand, is celebrated for its elegant syntax and strong focus on developer happiness, ...
🌐
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...
🌐
Hackr
hackr.io › home › articles › programming
Ruby vs Python: Differences You Should Know [Updated] 2026
January 30, 2025 - 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.
Find elsewhere
🌐
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 - Guide to Python vs Ruby. Here we discussed Python vs Ruby head-to-head comparison, key differences, infographics, and comparison table.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
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 - Python is also quicker to learn. Its readability and simple syntax make it the perfect language to learn for beginners, or more experienced programmers looking to learn an additional skill.
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!"    
🌐
Stackify
stackify.com › ruby-vs-python
Comparison: Ruby vs. Python - Stackify
April 11, 2024 - You can gauge this better considering your particular case and how much reusable code there is for your purpose. I won’t beat around the bush here: Python is hands-down quicker to learn. The syntax is easier to understand, and it’s more ...
🌐
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 - Python has a larger user base than Ruby does, so you have people with Python who aren’t using Django, whereas Ruby’s user base is smaller, but everyone who uses Ruby is going to be experienced with Rails.
🌐
UpGuard
upguard.com › blog › python-vs-ruby
Ruby vs Python: Comparing Languages | UpGuard
January 9, 2025 - This results in a language strict on layout and indentation and even the amount of whitespace to use (!), which of course feels stifling to Ruby proponents. 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.
🌐
Learn Enough
learnenough.com › blog › ruby-vs-python
Ruby vs Python: What’s The Difference & How To Choose?
January 12, 2024 - If you want to learn more about the power of Python in building data science applications, read the article ... Python remains the top language in demand, making it a safer bet for beginners.
🌐
Netguru
netguru.com › home page › blog › python vs ruby performance: a comprehensive comparison
Python vs Ruby Performance: A Comprehensive Comparison
February 3, 2026 - In conclusion, both Python and Ruby on Rails offer unique strengths in terms of syntax and readability. Python’s straightforward approach makes it ideal for beginners and data-driven applications, while Ruby’s expressive style and vibrant community make it a favorite for web development.
🌐
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.

🌐
Bacancy Technology
bacancytechnology.com › bacancy technology › blog › technology comparison
Ruby vs Python: Which Programming Language To Choose?
January 1, 2026 - Winner: Python empowers Ruby due to its higher performance and execution speed. Python is renowned for its clear and concise syntax, comprehensive documentation, and straightforward nature, making it one of the easiest programming languages to learn.
🌐
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.
🌐
Ruby
ruby-lang.org › en › documentation › ruby-from-other-languages › to-ruby-from-python
To Ruby From Python | Ruby
Both languages let you open up and modify classes at any point, but Python prevents modification of built-ins — Ruby does not. You’ve got true and false instead of True and False (and nil instead of None).
🌐
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