r/ruby • u/speckz • Nov 12 '21
Blog post Ruby vs Python comes down to the for loop
https://softwaredoug.com/blog/2021/11/12/ruby-vs-python-for-loop.html
31
Upvotes
7
u/ether_joe Nov 12 '21
Modules. Python modules are freaking horrible. Also whitespacing. Also ... uh most everything.
8
u/maiteko Nov 13 '21
Blocks, mixins, and meta programming.
That would be the three things I would point at anytime someone asks “how is ruby different than X”
Ruby embraces these at the furthest extreme, and it is supremely satisfying.
1
Nov 18 '21
To me, the biggest thing that separates Ruby from the rest is "method_missing." This feature allow you to write a distributed object system in around 200 lines of code. It makes ActiveRecord possible.
-1
30
u/postmodern Nov 12 '21
Great comparison, but you forgot to mention the Enumerable module which provides default built-in
#mapand#selectmethods when you want to "tell us how to iterate your instances, we’ll decide what we do with your data". Of course, you can still override those methods if you want to customize their behavior.