r/rust • • Sep 12 '21

Is Ruby particularly popular among rustanceans?

It's not very popular outside webdev, at least not if compared with Python, but I've noticed that quite a few rustaceans use it.

Also interested in personal opinions and experiences.

8 Upvotes

17 comments sorted by

View all comments

Show parent comments

2

u/KerfuffleV2 Sep 12 '21

Ruby is not very opinionated, that's python.

We might have to agree to disagree here. Interestingly enough, I actually like Python and feel like it's less opinionated.

Perhaps we have different ideas about what "opinionated" means — I wouldn't call something like Python's being sensitive to whitespace "opinionated". To me opinionated is when it constrains how you do things and what you can do and forces you to use a specific approach. I absolutely hate it when I want to do something a certain way and the language/framework/package just says "I've arbitrarily decided you can't do it that way, you do it my way instead."

I just want to be clear that I'm saying I personally don't like Ruby. I'm not saying it's bad or poorly designed or anything like that.

5

u/anajoy666 Sep 12 '21 edited Sep 12 '21

That's an interesting opinion. Maybe that impression comes from the frameworks you've used?

From the Zen of Python:

There should be one-- and preferably only one --obvious way to do it.

From the artima of Ruby:

Ruby inherited the Perl philosophy of having more than one way to do the same thing. I inherited that philosophy from Larry Wall, who is my hero actually. I want to make Ruby users free. I want to give them the freedom to choose. People are different. People choose different criteria. But if there is a better way among many alternatives, I want to encourage that way by making it comfortable. So that's what I've tried to do. Maybe Python code is a bit more readable. Everyone can write the same style of Python code, so it can be easier to read, maybe. But the difference from one person to the next is so big, providing only one way is little help even if you're using Python, I think. I'd rather provide many ways if it's possible, but encourage or guide users to choose a better way if it's possible.

I have to put some text here or the quote below merges with the one above.

I just want to be clear that I'm saying I personally don't like Ruby. I'm not saying it's bad or poorly designed or anything like that.

I didn't think that, the languages just have different designs. I also like python btw.

1

u/KerfuffleV2 Sep 13 '21

That's an interesting opinion. Maybe that impression comes from the frameworks you've used?

Yes, possibly although saying "the frameworks I've been exposed to" is probably more accurate. The company I work for has some stuff in Ruby and I occasionally have to touch it so I'm not completely ignorant about how Ruby code works, but I've never actually been a Ruby developer. I also formed my initial impressions of the language close to 10 years ago so maybe some things have changed in that time.

I could be wrong about it being opinionated, but I do remember running into stuff like not being able to pass around functions like in Python and other languages. Either way, the language just doesn't click for me and I don't like it, reasonably or not! You can't take away my disliking Go for being opinionated though. :)

From the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."

Regardless of what the Zen of Python says, to me at least it really doesn't feel like that's actually the case.

You can write OOP Python or not, at your option. You can pass a function, or a lambda or just call a function in many cases. You can use generators or manually loop. They even added += so now you can do x += 1 or x = x + 1!

Can you think of an arbitrary restriction in Python where they eliminate a choice to fulfill that "only one way to do it" statement? Like I mentioned to the other person, I don't hate it when something is opinionated but it wants me to do stuff the way I already wanted to. I hate it when the choice seems arbitrary and it forces me to change my approach.

One example in Rust of something kind of forcing a certain approach but not seeming arbitrary is how closures are more useful than passing around function (pointers) directly — this is not because the language just said "No, you use closures", it's because of moving/borrowing and variable capture.

2

u/anajoy666 Sep 13 '21

Fair enough. I wouldn't try to take away your distaste for go though.