[Discuss] Rust vs. C (was Re: Port Scanning)
Kent Borg
kentborg at borg.org
Wed Aug 7 15:19:46 EDT 2024
On 8/7/24 11:58, Rich Pieri wrote:
> What makes Rust interesting to me as an outside observer (I'm a
> sysadmin, not a programmer) is that Rust performance is competitive
> with C performance while producing much safer binaries.
I think the thing I like best about Rust, in the time I have programmed
it, is fewer bugs. Or at least fewer bugs that make it past the
compiler. Bugs are annoying!
I'm skilled, I can write bugs in any language. A lot of my bugs are
stupid little things that aren't at all consistent with the rest of what
I have written.
In Python, as long as the syntax is clean, I can do anything I want,
misspell my variables in subtle or gross ways. Some of these bugs will
not to be found until the program is in production, with valuable
customer data in its teeth, ready to fall over dead.
In C I do have to spell my variables correctly, and I have to get my
types right. That helps a lot. Except many C crimes hide behind "void *".
In Rust there is a whole lot of self-consistancy that the compiler will
insist upon. And once I make the compiler happy there are large swaths
of bugs that simply won't be there. Sure, I can still do things wrong,
and Rust can't really help with whether I have thought through the
business logic correctly.
Over all, Rust makes me a better programmer, saving me from my dumb
mistakes and typos, far sooner. Heck, since I got my emacs talking to
the Rust language server, a lot of my mistakes are caught as soon as I
type them.
I think C is for better programmers than am I.
-kb
More information about the Discuss
mailing list