* Posts by Gtdelarosa

3 publicly visible posts • joined 21 Sep 2022

Is it time to retire C and C++ for Rust in new programs?

Gtdelarosa

I don't see how Rust can really be considered any safer than C++ when it is still possible to have runtime errors when indexing into an array out-of-bounds.

That is the most common safety error in software.

You can avoid it by using iterators but that's also true of C++.

Of course, Rust programmers will say that a panick error is safe compared to undefined behavior but it's still an undesirable runtime bug.

And the author does not consider any of the downsides to using Rust which in many cases will outweigh the benefits of easier safety. You can also achieve safety easily in modern C++ with static analysis without having to give up backwards compatibility.

In Rust We Trust: Microsoft Azure CTO shuns C and C++

Gtdelarosa

I agree with Stroustrup. Using modern C++ along with static analysis to enforce core guidelines and rules can make C++ completely safe whilst still retaining backwards compatibility.

Static analysis is really no different than using a safety-oriented compiler like the Rust compiler.

It is better to make evolutionary changes as C++ did for C, rather than the revolutionary changes the Rust community is attempting. Any attempts to deprecate C++ will almost certainly fail.

Gtdelarosa

Re: Hold your horses!

The point is that Rust programmers are claiming that the language WILL save you despite writing bad code.

That belief is what is driving the enthusiasm for Rust despite being completely untrue.