> I’m sorry that people have implied that, but I feel most of the time when Rust people say languages like C should be retired or deprecated, are doing so because your skill and attention to detail does not scale.

This is a fair argument.

On the other hand, I wish we had less software so that attention to detail did not need to scale.

For example, I run a Gentoo machine with the Awesome Window Manager and no systemd. The end result is less than 50 processes running after I login.

My machine is powerful, but if I were running Gnome, it would still feel laggy. With this minimal setup, my machine is snappy even when running an update and compiling Rust, Chrome, Firefox, or anything else. (I did have to make my update script renice Portage to the lowest priority to make that happen, but it works.)

Nevertheless, it is good when less attention to detail is needed.

I'm making my own C replacement, and I'm going to rewrite my current project in it when it's done. It will be about as safe as Rust, if not safer because it will not have async/await.

> Maybe you personally have advanced enough to write safe code, and you have the requisite skills and insight to avoid any and all memory bugs, such that your C code is just as safe as what Rust would compile. That’s great.

Thank you.

> But there’s always someone starting out and they will not have your skills. They will make the use after free, null pointer deference, buffer overflows, and other issues that the C language not only allow but encourage.

Yes, they will. But I view this argument as equivalent to "roll your own crypto."

If no one actually rolls their own crypto, then we as an industry will lose the ability to do so, even when we need to. If nobody uses C, then we as an industry will lose the ability to do so, even when we need to.

When I started writing `bc`, I sucked at C. `bc` was so full of security holes.

So what I did was spend enormous amounts of time on the test suite and asserts and then hooked those up with sanitizers and Valgrind. Patterns of bugs repeated over and over.

But I eventually got to a point where I started to get good. I didn't release a 1.0 before that point; I waited until I was good and had done thorough checks with as many tools as I could learn.

I'm currently learning and implementing crypto. I am following the same process, except that I'll add in professional code audits by actual cryptographers, which I have to pass before I release the code.

I'm doing this because someone has to.

> So the question is: how long do we tolerate new programmers making these mistakes in production code, leading to bugs and exploits for all, when other languages are readily available that would have caught those mistakes before reaching production?

We should not tolerate this in production code, but this is a failure of the industry. Why are beginners writing production code in the first place?

This industry grew too fast for its own good. It would have been better if it had had a master and apprentice model. The best programmers would be "masters" (in the sense of master and apprentice), and juniors would be apprentices who would write code under the master until the master thought them good enough to be journeymen (moving up from junior), and over time, such journeymen would themselves come to be recognized as masters, and the cycle would repeat.

If the industry does not do that, we may soon lose the ability to do things we need to do.

(Funnily enough, this is another argument for less software because there will be less people to write production software, and they'll all be good at it.)

> C was released 50 years ago, and in the intervening time a lot has been learned about how to write programs, and what language features are desirable in enforcing those practices. We also learned that when practiced aren’t enforced, they aren’t followed. So “just write modern c++”, which is espoused throughout this thread, doesn’t work to make c++ code safer, because it’s not enforced. Not taking advantage of those lessons learned seems like folly, irrespective of how bug-free your particular C codebase is.

Surprisingly, I agree with you that it's folly. I really do. In my original post, I ended it by saying

> But seriously, use Rust if it's available for your target platforms, and you have no other preference.

People really should do that, even though I don't like Rust.

All I was doing was just to remind everyone that there is a time and a place for C.

By the way, the reason I don't use Rust is because I'm pretty sure I would actually write buggier code in Rust than in C. The reason for this is async/await: I just can't get it. I mean, I do get it, but the rules seem too complicated for my brain to do as safely as I can do threads and locks.

I think I am one of those people for whom async/await is dangerous, just like there are those that just can't get Lisp or Haskell.

I say this so people know I'm not some great programmer; I have my weaknesses like everybody else.

So it would be folly for me personally to write Rust.

At the same time, yes, it is folly to write anything but Rust if it works for you.