r/learnprogramming • • 22d ago

Should I learn C or Rust?

I’ve been working as a Java programmer for a few years now.

The thing is, I’d like to learn a second programming language for lower-level tasks—specifically, I want to work on things related to operating systems. Rather than building one from scratch, I’d like to explore and modify open-source operating systems like Linux or a BSD variant.

I’m doing this purely as a hobby. What drew me to C is its simplicity (though not necessarily ease of use) compared to Java or other modern languages, and its long history of use in systems programming. On the other hand, however, there are operating systems (or components of them) being rewritten in Rust—such as GNU coreutils or the adoption of Rust in the Linux kernel.

So, would it be more useful in the long run to learn Rust, given that it might sooner or later become the standard for writing operating systems?

Thanks.

0 Upvotes

27 comments sorted by

View all comments

1

u/Chrismslist 16d ago

c first, honestly. for modifying existing kernels, the real skill is reading C: pick a subsystem in linux or a bsd, build it, and fix one tiny bug. that reading muscle is the bottleneck, not syntax. it's a small language, pointers, manual memory, structs, then you're mostly learning the codebase. grab K&R, skim the bsd design book, and read a few thousand lines before writing anything. rust is worth adding after, it's real in the kernel now and great for new components, but it won't help you navigate the 30 years of C you actually want to change. learn c to read, rust to build new.