News for hackers. Stuff that matters.
Re:Ask HN: Why Did Python Win? by kstrauser on Tuesday August 29, 2023 @05:01PM (#37314034)
For me, the Ruby community's comfort with monkey patching was a big turn off. In Python, you can hack around on class and replace its methods, but if you do, it's expected that your coworkers might stick you in a dunk tank and sell tickets. It's just not the thing that's done.
Re:Ask HN: Why Did Python Win? by nextos on Tuesday August 29, 2023 @05:26PM (#37314361)
Monkeypatching is maybe more of a Rails thing than Ruby. I think the biggest problems with Ruby around the time Python began to take off were slowness (MRI was a disaster, slow, and full of memory leaks), plus patchy documentation (lots of things were in Japanese).

Still, I preferred and prefer Ruby. Python has fantastic libraries, but it is a mediocre language. Ruby feels like a simpler version of Perl + Smalltalk, and it is a joy to use. Python has intentionally crippled anonymous functions plus syntactic whitespace, which often leads to long and ugly code.

I think it is a shame Guido hated functional programming and he did not embrace an Algol-like syntax with begin/do end blocks. Those two things could have vastly improved Python. Ruby's block, procedure and lambda design is a stroke of genius that yields beautiful code and makes DSLs trivial.

Re:Ask HN: Why Did Python Win? by fuzztester on Tuesday August 29, 2023 @11:42PM (#37317408)
>Ruby's block, procedure and lambda design is a stroke of genius

Hardly. Not only was it nothing great, it had many variations, making it harder to remember.

Re:Ask HN: Why Did Python Win? by EdwardDiego on Tuesday August 29, 2023 @05:13PM (#37314193)
I figure if Django built an entire framework around metaprogramming, I'm going to do it to Django model objects as a form of vengeance.
Re:Ask HN: Why Did Python Win? by kstrauser on Tuesday August 29, 2023 @05:16PM (#37314242)
I want to see the malicious wonders you can create!
Re:Ask HN: Why Did Python Win? by EdwardDiego on Tuesday August 29, 2023 @05:34PM (#37314448)
An easy way to start taking the fight back to the enemy is by overriding __new__ and tinkering with things before/after Django's metaclass __new__ does its own metafoolery.

Also overriding mro() is a fun way to monkey with the inner workings.

Re:Ask HN: Why Did Python Win? by fuzztester on Tuesday August 29, 2023 @08:58PM (#37316290)
Whereas in Ruby you get to go to a conf for doing that.
Re:Ask HN: Why Did Python Win? by fuzztester on Tuesday August 29, 2023 @11:38PM (#37317381)
Re:Ask HN: Why Did Python Win? by JohnBooty on Tuesday August 29, 2023 @10:10PM (#37316817)

    For me, the Ruby community's comfort with monkey patching was a big turn off
If it helps, the Ruby community really soured on monkeypatching in general quite a while back. You don't see it much these days and every decent book or guide warns against it.

It was definitely a crazier place 10+ years ago in the early Rails days.

Re:Ask HN: Why Did Python Win? by fuzztester on Tuesday August 29, 2023 @11:37PM (#37317373)
>It was definitely a crazier place 10+ years ago in the early Rails days.

Yeah! It sure was.

I was around, was an early Ruby and Rails adopter, and worked on a few commercial Rails projects at that time.

That's how I know about the monkey patching issues. Faced them in real life.

Re:Ask HN: Why Did Python Win? by JohnBooty on Wednesday August 30, 2023 @09:50AM (#37322150)
I certainly wouldn't blame a person for experiencing those crazier days and thinking the community didn't have the greatest technical vision.

I played around with Rails and Ruby when Rails first blew up. But I didn't start doing it fulltime professionally until 2014. By the time it seemed to me that the community was maturing. I think it's in a good place now.