News for hackers. Stuff that matters.
Re:Ask HN: Why Did Python Win? by skeletal88 on Tuesday August 29, 2023 @05:36PM (#37314477)
There are just too many ways to do things in Ruby. How many forms for an if-else or for loopin can you name in Ruby? Just as the simplest example.

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

Re:Ask HN: Why Did Python Win? by aae42 on Tuesday August 29, 2023 @07:36PM (#37315622)
I've been writing Ruby daily for years and never written a `for` loop
Re:Ask HN: Why Did Python Win? by stouset on Wednesday August 30, 2023 @06:44AM (#37320008)
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.
Re:Ask HN: Why Did Python Win? by BobbyJo on Tuesday August 29, 2023 @08:18PM (#37315994)
Python fixtures anyone?
Re:Ask HN: Why Did Python Win? by nextos on Tuesday August 29, 2023 @09:09PM (#37316377)
> 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.
Re:Ask HN: Why Did Python Win? by nijave on Tuesday August 29, 2023 @10:15PM (#37316849)
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`.