r/learnprogramming • • 6h ago

Learn rust

Could you tell me what the situation is with Rust? Is it worth learning, looking ahead to the next 5 years? Or would it be better to learn C instead?

4 Upvotes

14 comments sorted by

View all comments

3

u/sessamekesh 5h ago

Rust is great, and you'll definitely pick up some C along the way if you're learning Rust.

I personally think it's really silly to either/or when C is one of the options, C is a stupidly simple language (simple, not easy). If you have your feet under you with Rust, C will take you maybe a weekend or two to pick up. 

I would still start with Rust though. The compiler is actually your friend (... Generally) and it forces you to take on a mindset that will be very useful when you pick up C.

Above all though I'd suggest not becoming a one trick pony with Rust. That way lies sadness.

2

u/dmazzoni 5h ago

I basically agree with this take. I don't think it matters which order you learn them in.

Learning C and struggling with memory errors will help make it clear why Rust was invented.

On the flip side, struggling trying to get something in Rust to compile, when you know it's safe, will make you appreciate how simple C is.

In terms of career: even with as fast as Rust is growing, there's 1000x more C code out there than Rust code. Most jobs are in improving existing code, not writing new code from scratch. So the odds that you could have a job that involves writing Rust and never touching C is quite low. Most real-world jobs use multiple languages, and mixing C and Rust is quite common.

2

u/baked_salmon 4h ago

I think if you really wanted to be comprehensive, you’d do a touch of C, a touch of C++, and then Rust. It’s hard to appreciate Rust IMO without understanding what motives its design around memory safety and why it’s seen as a C++ successor.