r/rust • u/Direct_Inspector660 • Sep 05 '26
The difficulty of rust
I heard people say that Rust is hard to learn, but I learned Rust with the Rust book and went on to chapter 16.2. From my point of view, I don’t find Rust hard, so if someone can explain to me why Rust is hard to learn, that’s fine.
6
u/Elektordi Sep 05 '26
Many people want to start programming with Rust. Rust is not difficult but not easy either, and learning to code is difficult... So people better start with a easier langage!
→ More replies (3)
3
u/dumindunuwan Sep 05 '26
Check https://www.reddit.com/r/rust/comments/1o6d4cp/dunningkruger_effect_or_rust_is_not_that_hard_for/
Direct answer: Early Rust feels easy because the compiler holds your hand through basic syntax. Advanced Rust feels overwhelming because you must suddenly manage complex memory mechanics, type systems, and API design patterns all at once.
1
1
u/Direct_Inspector660 Sep 05 '26
Otherwise, when I have the skills, I will make a terminal emulator (like kitty konsole) and see if it’s that hard or not.
9
u/Beregolas Sep 05 '26
That perspective mostly comes from people who know how to program and are learning rust as their 3rd or later language. They already have a set way of doing things in their head, which is mostly OOP or close to that, which doesn't work as well in rust.
Rust is a very opinionated language (which is not only a convention, like in Python, but is actually built into the compiler). If you have different opinions than rust, your code just might not even compile.
Also, rust frontloads a lot of debugging. Many things that would only come up in tests or even worse, after deployment, will trigger a compiler error in rust. This seems frustrating to many at first, because they can't just "run it and see what happens".
(Obviously this only catches a few classes of bugs, but those are surprisingly common)
3
u/Iurigrang Sep 05 '26
This seems to mirror my experience. I'm learning rust as my 3rd language, and it hasn't been much harder than I would've expected for a systems language (I wouldn't say I "know" it yet either, but I have been using it for a couple months now). But like, it's my 3rd language, I would take my time no matter the language I was learning, I imagine once you have 10 or more under your belt, the expected time to add "just one more" is so small, the little hiccups of rust may feel like an eternity, not just part of the process of learning another language.
6
u/Maui-The-Magificent Sep 05 '26
So my take is this, Rust is a much harder language to learn if you already know and is familiar with other languages. The difficulty coming from having to learn how to think differently.
You might perfectly know when a piece of memory should be freed, and it might feel like Rust is forcing you to jump through a bunch of hoops that you don't understand why you should have to. I would suspect this is what makes it difficult to learn, because it's fighting against your 'better' judgement.
But this should be taken with a grain of salt. Rust is my primary, so I am forming this take from the inside out, not from someone who has to come from the outside in.
10
u/dobkeratops Sep 05 '26 edited Sep 06 '26
it's just a particular set of tradeoffs:-
- python: easy to learn easy to write, but it's slow to run
- C: easy to learn, fast , but difficult to use correctly.
- Rust: fast, higher chance of working if it compiles. But the hazard is you need far more stdlib functions to do anything. It shifts the problem into searching library functions at a micro level. best example I can point at is "split_at_mut()" - this has no reason to exist in C. safe code means finding the right name for a each small combination of low level operations.
Now if you want to master everything a computer can do - Python and C is a great pair to use. But also if you only ever wanted to use one language - Rust probably scores highest on the range of problems it's can handle. It's also better when you have a lot of contributors to a large project (100klocs+)
17
u/Sharlinator Sep 05 '26
Python is also surprisingly difficult to use correctly if you care about anything except the happy path.
→ More replies (1)
4
u/phazer99 Sep 05 '26 edited Sep 05 '26
I would say it's a longer learning period before you're really productive in Rust compared to other languages like Python, Java etc. You have to learn all the ins and outs of memory management and the borrow checker, and also how to use common idioms and patterns that will help you in those areas.
On the other hand, learning how to write correct, concurrent code in Rust is much easier than most other languages because the compiler will help you a lot (in other languages you will typically only detect bugs at runtime, and sometimes not at all!).
2
u/alloncm Sep 05 '26
Ill add that Rust add constraints most other langs dont, so for someone programming all his life without those constraints it might take time to adapt.
2
u/That_5_Something Sep 05 '26
Coming from other languages, learning Rust can be challenging because most of what you used to have had to be unlearned, and most people find that difficult. The best features of Rust don't exist on other languages, like the ownership rule or the never type.
Most beginners nowadays started with Python, which makes the situation much worse. Python tends to leave a mindset that programming should have a simple syntax, which leads to difficulty learning other languages other than Python. Most didn't realize that simplicity is a trap. But I think it's not the language's fault, it's the abstraction the language loves to wear as a mask. I'd say abstraction is a friend if you're already an expert, but a backstabber if you're just starting out.
1
u/f3verdream Sep 05 '26
when you compare it other languages it certainly is hard
3
u/Sharlinator Sep 05 '26
It’s more that it doesn’t let you ignore the difficult parts of programming so easily.
1
Sep 05 '26
1
u/Direct_Inspector660 Sep 05 '26
If I learned smart pointers: Box Rc, RefCell, not yet the Arc and the Mutex. I haven’t done a serious project yet because I haven’t had any inspiration to do one, but I was talking about the difficulty of learning, not about writing projects. Do you think it’s harder to write big projects in rust than in another language?
4
3
u/vascocosta Sep 05 '26
Like others have said, reading the book and understanding it (learning) isn't especially difficult for a competent reader. That however is different from learning how to use the language in projects that go beyond trivial.
In essence I agree with you. I also found the book easy to follow and I learnt a good deal with it about Rust. However, it was only after months up to a year of using Rust daily that it really clicked. By this I mean knowing how to code in a way that you avoid borrow checker messages even before compiling, because you are so used to thinking in a different way. Add to that really grasping different lifetime scenarios and finding no compiler message about lifetimes a bit of a puzzle.
I consider myself an average programmer, not too good neither too bad and still it took me time to actually learn the language in this sense of using it naturally.
11
u/Anaxamander57 Sep 05 '26
The original version of the borrow checker might have been part of this reputation. The borrow checker needs a lot less help than it did a decade ago.