Can Rust teach me how to write secure code in C?

I have recently been trying to redo all the Learn C the Hard Way exercises in Rust, and I have noticed that (so far) all the C code is really easy to rewrite using Rust. This is surprising to me, because when I try to write my own Rust code, I keep getting yelled at by the compiler that what I am doing is unsafe.

Does this mean if I want to be a good C programmer, I should try to write C code as if I had to write it for a Rust compiler? I really want to become a competent systems programmer, but right now the market for Rust jobs (at least where I am from) is practically non-existent, so I want to become a solid C coder for the time being, and relegate fun projects to Rust.

1 Like

Probably, but I think most everything you wanted to do in C you could just do in Rust and forget about C. Otherwise you could get proficient in Rust, and then probably read a couple books on C and “port” a few things to it.