Get the latest tech news
Ruby vs. Python comes down to the for loop (2021)
Contrasting how each language handles iteration helps understand how to work effectively in either.
Pythonic code uses list and dictionary comprehensions to implement map and filter, with the same for/iteration semantics at the core of those expressions. In C-based OO, like with posix file descriptors or Win32 window handles the language doesn’t enforce bundling ‘methods’ with the object itself. Special Thanks to Felipe Besson, Simon Eskildsen and John Berryman for reviewing this post and giving substantive edits and feedback!
Or read this on Hacker News