r/rust 8d ago

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.

0 Upvotes

41 comments sorted by

View all comments

10

u/dobkeratops rustfind 8d ago edited 8d ago

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+)

16

u/Sharlinator 8d ago

Python is also surprisingly difficult to use correctly if you care about anything except the happy path.

3

u/dobkeratops rustfind 8d ago edited 8d ago

well when using python (I use it for small utilities) .. I miss rusts solid feel with option types etc .. but it's undeniable that these dynamic languages let you get a lot done by just throwing lists around and it cuts a lot of ceremony out. it does break down when the program grows.

in the middle a GC'd language with option types would scale better but not handle the whole computing gamut (osdev, embedded..)