4 ms·
Hey there! Rust core team member and long-time C programmer here. The short of it is, this is complicated, and it really depends on individual circumstance. Yo
by steveklabnik 6y ago
Hey there! Rust core team member and long-time C programmer here.
The short of it is, this is complicated, and it really depends on individual circumstance. You have given your circumstances, so I can help answer on that basis, but doesn't mean I agree it's the same for everyone.
There are two major ways of thinking here: Rust first, or C first. The advocates for Rust first will point to an easier onboarding story, a supportive community, a helpful compiler, and that you'll start off with good habits. The advocates for C first will point out that C is the latin of software development, and that you may not appreciate what Rust does for you without first experiencing the wild west of C.
Both of these have merits. I personally prefer Rust first. I of course, have a lot of bias.
I work in embedded Rust, and the thing is, the industry is still C based. Depending on which embedded devices, it may be your only option. So, I don't think there is any world in which you cannot learn C. Even though my codebases have no C in them at all, data sheets refer to C concepts, example code from vendors is all in C, blog posts and other helpful documents are generally in C.
So, absolutely, learn C to some degree.
Personally, what I would do in your situation is this: pick up a copy of K&R. Pick up a copy, either online for free, or in paper, "The Rust Programming Language." (I am a co-author. I don't make any money from the book; I recommend these two because they are generally considered the go-to book for each language.) Read them. See what speaks to you. Go from there. There is no reason you have to make a big choice up front and commit to it to all time. Try things. See what makes you go "I want to do more of that." And then move forward. Maybe you'll love C and never learn any more Rust. Maybe you'll like Rust and stick with it primarily. No way to tell until you give them both a shot.
(I actually strongly disagree with many of the ways that people characterize C, and even in this thread. C is not actually a small language, it is not super simple... but that doesn't mean it's not worth learning.)
- jeff-davis 6y ago"C is not actually a small language, it is not super simple." Can you expand on that? Clearly C moves a lot of complexity to other areas, or hides complexity by using subtle semantics. But in the context of learning/hacking that isn't necessarily bad.
- steveklabnik 6y ago> Clearly C moves a lot of complexity to other areas, or hides complexity by using subtle semantics. This is what I mean. I do think it's tough in the context of learning, because many resources will teach you things that are actually technically incorrect, but work enough of the time that you won't always notice it. And it's really really tough to know if what you've done is even correct, because you don't have a ton of help. This is before you even get into the bevy of flags which can change language semantics, and are actually used by real projects. You also have to deal with different social groups of people who have different beliefs about what the language even is. https://raphlinus.github.io/programming/rust/2018/08/17/undefined-behavior.html https://raphlinus.github.io/programming/rust/2018/08/17/unde... This is what leads to a lot of those conflicts about semantics too. None of this means C is not worth learning, or that you shouldn't do it. But I think suggesting that it's simple in the way that, say, Go is a simple language to learn, just isn't really true. YMMV.
- abnry 6y agoThank you, I appreciate your comment!