Live data from Hacker News

Ruby vs. Python comes down to the for loop (2021)

softwaredoug.com

1–10 of 193 posts

Re: Ruby vs. Python comes down to the for loop (2021)

#3
post #2

I've done a lot of SRE work and two stints at companies with RoR stacks. Really have kinda soured on Ruby and Python at this point and it has little to do with loops. If I had to choose though it would be Python for asyncio.

What issues did you have with python?

Re: Ruby vs. Python comes down to the for loop (2021)

#4
> Ruby keeps going with its methods-first approach, except instead of each we have a new set of methods commonly implemented on collections, as below

Once you implement `each`, `include Enumerable` is all it takes to get the full set of collection methods (including `max`/`min` etc, if the entries define ``).

Re: Ruby vs. Python comes down to the for loop (2021)

#5
post #2

I've done a lot of SRE work and two stints at companies with RoR stacks. Really have kinda soured on Ruby and Python at this point and it has little to do with loops. If I had to choose though it would be Python for asyncio.

The omitted context in this comment is that the RoR stack propelled those 2 companies to the level of usage and viability where they needed, and could afford to hire, SRE engineers.

I'm not saying RoR doesn't have its faults, I've left it behind too. But I can't deny its productivity, and even in 2024 I would be hard pressed to name something better for a SAAS company starting out.

Re: Ruby vs. Python comes down to the for loop (2021)

#6
post #3
post #2

I've done a lot of SRE work and two stints at companies with RoR stacks. Really have kinda soured on Ruby and Python at this point and it has little to do with loops. If I had to choose though it would be Python for asyncio.

What issues did you have with python?

I just prefer the experience, tooling, and performance of other languages more. Honestly two of my biggest "pains" with it were resolved the last time I was using it professionally via pipenv and asyncio.

For use cases outside AI, and perhaps some niche stuff as a bash replacement since its pre-installed on most distros, it's in a sorta no man's land where I believe there are better options and the industry activity has moved on.

Re: Ruby vs. Python comes down to the for loop (2021)

#7
This is because Ruby inherits it's approach to flow control from Smalltalk, while Python comes from a C/Algol-like heritage.

In fact, Smalltalk takes this much further, such that basically all flow control (including if-then-else) is handled as message sends (e.g. if-then is just a message sent to the Boolean object taking a block as it's argument).

The downside is the syntax can feel a tad clunky. The upside is incredibly simple and consistent language grammar, while making it trivial to create new flow control mechanisms since the language has all the tools baked in (primarily first class blocks).

Re: Ruby vs. Python comes down to the for loop (2021)

#8
post #2

I've done a lot of SRE work and two stints at companies with RoR stacks. Really have kinda soured on Ruby and Python at this point and it has little to do with loops. If I had to choose though it would be Python for asyncio.

> If I had to choose though it would be Python for asyncio.

I can think of lots of reasons to prefer Python over Ruby, but asyncio in Python compared to Ruby’s async is not at all one of them.

Re: Ruby vs. Python comes down to the for loop (2021)

#9
post #5
post #2

I've done a lot of SRE work and two stints at companies with RoR stacks. Really have kinda soured on Ruby and Python at this point and it has little to do with loops. If I had to choose though it would be Python for asyncio.

The omitted context in this comment is that the RoR stack propelled those 2 companies to the level of usage and viability where they needed, and could afford to hire, SRE engineers. I'm not saying RoR doesn't have its faults, I've left it behind too. But I can't deny its productivity, and even in 2024 I would be hard pressed to name something better for a SAAS company starting out.

I’ve tried so many stacks on side projects and always come back to RoR (with a bit of a grudge).

I dislike many things about Ruby, but RoR is extremely hard to beat. Basically, everything you need in a stack is provided or readily available in the community.

Re: Ruby vs. Python comes down to the for loop (2021)

#10
> So much of how Ruby and Python differ comes down to the for loop.

I wish we wouldn't try to simplify the wildly different philosophies of language into a single "thing". From imports, loops, calls, sub-classing, chaining, multi-lines, blocks - there are just so many differences that materially matter.

That said, regarding the loop itself, I agree with the article. I come from not-C background and looping in Ruby has always been a pleasure because it feels more natural especially once you include chaining.

Post reply on HN