Hacker News new | ask | show | jobs
by TheGrim-999 1981 days ago
Interestingly, comments like the one you're replying to are the reason why I'm ignoring Rust.

It's reached critical mass, meme status, where people will come in and shill for Rust or shill for how bad C++ is, not for any concrete or logical reason, but just because they've seen other people say the same thing. Which then, by becoming yet another person memeing that idea on, encourages more people to hold and repeat the same opinion, which then encourages more people to hold and repeat the same opinion, and so on. It's a viral idea, there's no stopping it at this point.

The people repeating the same lines rarely have any actual reason to repeat them other than the fact that they think they're true since they've seen so many other people repeat them. They'll just come in and assert that "C++ is an anti-pattern", with no rationale, no facts, no arguments, it's more political than technical, it's a mantra they've been brainwashed into repeating since everyone else in their echo chamber is repeating it. Of course this same pattern of a viral idea/meme extends much further into politics and all other areas of our life, enabled by the internet / mass media.

Maybe objectively C++ is pretty horrible and Rust is great, I'm not even saying anything about the objective reality of the situation. It's just so easy to spot the patterns at this point, across all areas of conversation, that I now just by default ignore and assume false anything that shows the same viral pattern, because I know the viral pattern is usually backed by nothing but itself. Maybe in the past if enough people believed something to be true it'd be easier to assume there's some reason for them to believe that, but in the era of the internet / mass media that's pretty much gone.

1 comments

I've worked on large C++ projects. Debugging hard to find data corruption, data leaks, data races was one of the most frustrating aspect. In a 200kloc project with 10 devs, there was always a crash worthy bug. Always. Automated tests could only catch so many things. Often the crash made it to the end user, causing them to lose valuable work and time. It sucked.

By far though some of the worst issues were ones involving heap fragmentation because of all the damn heap loving C++ classes and shared_ptr wrappers.

Rust doesn't solve everything. But it solves the most time consuming parts of C++ for me. Debugging. I've yet to need a debugger for Rust, after 5 years writing many 10s of thousands of lines of it. I trust the random crate I pull in won't segfault on something asanine if it stays away from unwarranted unsafe usage.

It's a breath of fresh air to not need a GC, be able to trust most other code won't cause a crash, and that once it compiles it's most likely going to work barring any logic bugs. It saves me immense amounts of time, and mostly avoids debugging hard issues in production. Mostly.

While people sit in their debuggers adding watch points, stepping through some 3rd party lib to figure out a crash, I'm busy working on the next killer feature.

I completely agree with you, I'm programming in C++ in my job and I've dabbled in Rust a bit. The issues in C++ are 90% ones that you wouldn't have in Rust

However my reply to the higher up comment was because you can't switch every project away from C++. I think it's a good idea to start most projects where you would have picked C++ in Rust now, just that it's infeasible for a lot of code, given the mountains of code that exist in C++.

Also plenty of code needs certifications that just don't exist for Rust yet.

So saying C++ is an anti-pattern is kind of correct, but it doesn't help you if you have to deal with it.