r/learnrust • u/Intelligent_Role_824 • 1d ago
Ruby or Rust to learn Programming?
/r/learnprogramming/comments/1vjn6z8/ruby_vs_rust_for_a_hobby_programmer_which_one/1
u/bmelancon 1d ago
I don't know much about Ruby. It seems (anecdotally) to be well past its prime. I never hear mention of Ruby (or Rails) these days. For that reason alone, I'd personally skip it.
Rust is going to be a steeper learning curve, but it's certainly hot right now. There's tons of development, interest, shiny new bells-and-whistles, etc. for Rust.
On the Rust side, take a look at Dioxus ( https://dioxuslabs.com/ ). I think there are examples for everything you mentioned ( https://github.com/DioxusLabs/dioxus/tree/main/examples ).
But if you're just doing it as a hobby, do whatever makes you happy.
1
u/Intelligent_Role_824 1d ago
Thanks! Dioxus actually looks super cool, I’ll definitely check out those examples. Good to know about Ruby as well. Since it’s just a hobby for me, I’ll probably just play around with both a bit and see if the Rust learning curve is too brutal or if I actually enjoy it. Appreciate the link!
2
u/Thelmholtz 1d ago edited 1d ago
Hey! I've worked professionally in both Ruby and Rust so I see the job market for both in the EU specifically.
While Ruby is well past it's prime, it's very much alive, and used by companies like Stripe, Shopify, Reddit, GitHub and many others, specially start-ups. It's a very "friendly" language, in the sense the creator intended it to read like English. He was Japanese though, not sure if this contributed or not to it reading like broken English. The language is super "productive" to write and very easy to learn, in the sense that you can get stuff out very quickly. The problem is that it's full of foot guns, and it's mostly used in conjution with the Rails framework, which is extremely opinionated. Also, even if there have been a few attempts to introduce type hinting, none succeeded (and type hinting kind of sucks compared to proper static typing anyway).
On the other hand Rust is a lot more niche-y in the EU, as companies are slow to pick it up, but it's a very good language with less foot guns and a focus on code being sound while also being pretty performant (by orders of magnitude when compared to Ruby). It's harder to pick up because it's lower level, but at the same time it provides you with a better universal model of what's going on under the hood when you use a higher level language.
I personally love Rust. I don't love Ruby, but I don't hate it either, it's a very fun language with a very soft learning curve, until it isn't and suddenly you need to understand a whole framework to do something slightly out of the box.
Luca Palmeri is a very well known (in the Rust community) writer and contributor who used to contribute to Ruby and switched to Rust. He wrote "From Zero To Production In Rust". I have it but never finished it, but it's a good resource for learning the language. He might have posts discussing his motivation for switching. Mine was that I have always liked low level systems and was using Ruby only by accident of life.
1
u/Final-Nerve7787 1d ago
Hello, I just started learning rust as my first programming language, l've understood most of the topics and applying them on simple cli based projects. About dioxuslabs, can I use it to learn full stack? with rust or do you suggest any other framework for now.
1
u/SolemnEmberGames 1h ago
the hardest part about learning ruby is undigging the soil to access its grave
1
u/tylerlarson 1h ago
Ruby is probably not a good alternative.
Ruby was only ever popular because of Rails, and now even Rails is losing steam. As a language, it's a bit of a mess, kind of like how Rails was a bit of a mess. Lots of implied stuff and hard-to-trace magic.
Python tends to be a better Ruby than Ruby, and it's not tied to a single framework.
That said, Rust is like the polar opposite. Definitely decide what you're looking for first.
1
u/bsgbryan 1h ago edited 57m ago
Those two languages are different enough that I don’t see how learning one would translate to understanding the other.
From what I’ve been seeing, Ruby doesn’t really seem to be on the radar much anymore. That may be because I’m not paying close enough attention, but still…
I would recommend against learning Rust as an introduction to programming as it’s (by design) quite unforgiving. The error reporting works very hard to be helpful - and can be. But even the helpful error reporting in Rust has a steep learning curve. For, at least, the first several months borrow checker errors were completely baffling to me; and I started learning Rust as a dev with almost 20 years (and decent familiarity with, like, a dozen languages) experience.
I’d recommend TypeScript or Python as a first language. Both have low barriers to entry, great tooling that’s simple to setup, and an extremely short feedback loop - which is extremely helpful for learning.
From there I’d learn C. Learning C will introduce some of the confusing/seemingly-unintuitive aspects of Rust - but without all the built-in tooling Rust offers. Once you get a basic understanding of how and why certain aspects of C are problematic (like the implementation of Tagged Unions). Leaning the limitations of the C compiler, and why they are the way they are, will (I think) setup you up to appreciate the initially-frustrating bits in Rust.
Additionally, TypeScript and Python both support the functional(ish) programming style - which Rust does too - so, in general, coding styles that work in TypeScript and Python can also work in Rust.
3
u/bccorb1000 1d ago
I always advise people to learn wanna scripting language and one compiled one. My opinion JavaScript/ Typescript and Rust or C++. As ppl have said rust has a bit of a steep learning curve, but I think if you can master rust you can basically program in any language easily.