I've been writing Ruby daily for years and never written a `for` loop
Started Ruby in 2007 and have used it professionally essentially nonstop. I have also never written or seen a for loop. I don’t even think I could correctly guess the syntax of it.
Python fixtures anyone?
> There are just too many ways to do things in Ruby
I think this is not completely true. Ruby is conceptually very simple. It's not C++ or Perl. Everything is an object, and everything is done through method calls. There is also extensive support for functional programming, so iteration is performed via filter/map/reduce and similar high order functions. Besides, the block/proc/lambda design makes it easy to turn APIs into DSLs.
For those reasons, Ruby gives the closest experience to programming with Scheme I have ever experienced outside the Lisp world.
Re:Ask HN: Why Did Python Win?
by twobitshifter on Tuesday August 29, 2023 @09:33PM
(#37316564)
Monkeypatching exists in both ruby and Python.
It does but it's generally considered a bad practice in Python (and many other languages) and a feature in Ruby.
Re:Ask HN: Why Did Python Win?
by sodapopcan on Tuesday August 29, 2023 @09:42PM
(#37316630)
Two: `for` and `each`. Most people use `each`.
Monkeypatching is also awful for readability.
Explicit imports are way more readable than things appearing into current namespace implicit kind of stuff like it happens with Ruby