4 ms·
>"And while there are certainly plenty of footguns and unsafe things you can do in C++" If I want to shoot myself in the foot I should have full rights and the
by FpUser 5y ago
>"And while there are certainly plenty of footguns and unsafe things you can do in C++"
If I want to shoot myself in the foot I should have full rights and the ability to do so.
In a normal coding however modern C++ is very reasonable language and I do not recall stepping onto any landmines in a last few years even though my code runs high load / high performance business servers that also do a lot of calculations.
- ncmncm 5y agoThis. It is quite easy to steer clear of unsafe constructs, and is less work. The people who trigger footguns are mostly those trying to code as if they were still coding C. Their code is typically slower, too.
- kelnos 5y agoUnless you are a perfect programmer, you will sometimes make a mistake, and shoot yourself in the foot even though you didn't intend to. Perfect programmers don't exist. Everyone will screw up sometimes. With Rust, I know that my code will be free of memory errors and data races as long as I never use `unsafe`. No one can say the same about a C++ program, not with certainty. If you don't care, that's fine (I guess), but please don't get all huffy with those of us who do. I think it's telling that you seemed to need to get all defensive even considering that my original post was in support of the libtransmission author using C++ instead of Rust.
- hutzlibu 5y ago" No one can say the same about a C++ program, not with certainty." Formal proof is a thing, so I think you can. "Hello world" would be easy to verify. Verifying transmission on the other hand, is a kind of big project on its own, though. And I agree, that there are no perfect programmers around, but I would also agree to parents point, that if I want to have full power, I fully want to remain my right for footguns. It all remains a tradeof. The ecosystem of C++ is just incredibly bigger than rust, so a new game, I would start in C++, but for something critical I would probably also choose rust.
- junon 5y agoJust because you can't rely on the compiler to tell you, doesn't mean memory errors exist. There's this weird idea Rust programmers have that since C++ doesn't force you to write less performant code by bowing down to a borrow checker that isn't smart enough to handle e.g. single threaded futures and locking properly, that it is IMPOSSIBLE to write memory safe C++ code. A piece of code without memory errors is, by definition, memory safe. This whole idea of "every piece of code has bugs" is some new-wave tripe coming out of code camps and the web development scene.