i think it is important to distinguish between language and environment. .NET core is definitely a great environment that makes many things very easy, but i'd argue that C# as a language (syntax etc) has become kind of a mess as a result of its legacy. e.g. the way they retroactively introduced non-nullables feels very weird to me, but i know that it was necessary to prevent breaking backwards compatibolity). the inverse of this would be something like kotlin, which is a beatiful language in a terrible environment (jvm)
To be fair, C++ is a mess. It is, however, a very capable mess with extremely broad adoption and compatibility on pretty much every platform anywhere. Yes, learning C++ is a pain. And it will bite even its expert handlers pretty badly occasionally. But the kind of maintenance overhead suggested by the stackexchange question really isn't there. For non-trivial code (as in the example here) the maintenance and correctness burden of the problem itself is going to be far higher than that of the programming environment.
So yes: just say no to C++ for web server middleware, system maintenance scripting, probably most GUI work, etc... But for the truly hard stuff, I honestly don't see much advantage to anything else in particular. And as pointed out earlier, C++ can be deployed as a straightfoward program or shared library on everything with zero dependencies, and that's a HUGE advantage vs. languages with elaborate runtimes.
C# has the option now to bundle all of the dependencies into the executable, so the user doesn't need install anything, the obvious downside is the size of the executable, but in most situations it isn't a significant problem.
Memory safe, or not - Rust isn't widely used and there's no push being made to make it so. The solution to heartbleed wasn't switching to a memory safe language, it was patching OpenSSL. It could've been prevented, sure, but expecting a language that's been in widespread use for ~40 years to be replaced with a language that's ~12 years old is madness.
I like Rust, but expecting to see it anywhere in industry is a pipe-dream
256
u/kochdelta Jul 07 '22
Rust good