“Rust’s compiler prevents common bugs” So does skill. No offense to you, but, this trope is getting so tiresome. If you like the language then go ahead and use it. What is it with the rust crowd that they have to come acrosslike people trying to convert your religion at your front door?
- if your skill is so great that you would never cause the kinds of bugs the rust compiler is designed to prevent, then it will never keep you from compiling, and therefore your complaint is unnecessary and you can happily use rust
- if you do encounter these error messages, then you are apparently not skilled enough to not use rust, and should use rust
In summary: use rust.
I don’t agree with /u/red-crayon-scribbles ’ approach to memory safety, but what you’re saying isn’t entirely true either.
It is possible to manipulate memory in ways that do not conform to Rust’s lifecycle/ownership model. In theory, this can even be done correctly.
The problem is that in practice, this leads to the following, many of which were committed by some of the most highly skilled C developers alive, including major kernel contributors:
…echoing statements expressed by hundreds of thousands of programmers who use the only language where 90% of the world’s memory safety vulnerabilities have occurred in the last 50 years, and whose projects are 20 times more likely to have security vulnerabilities.
ooof.
You can do that in Rust with the unsafe keyword
but that’s just a choice whereas in C you have no choice but write flawless code.
deleted by creator
Your first point is not true. There are valid uses of memory sharing that rust will reject.
Curious what you are talking about. Multi-threaded sharing of memory for example is also easy with rust, it just doesn’t let you wrote and read at the same time, and so on.
Off the top of my head, single-threaded writing to the same memory from different fields of a struct. Not to mention self-referencing like if you want to hold a buffer and have different views into it in the same structure.
Classic example: A linked list
… are entirely possible, even if rarely the right choice.
With unsafe, but how can you write a double linked list in safe rust? (without indices)
This so true, every one complaining that the borrow checker is annoying isn’t apparently aware what they used to do was inherently flawed. Sure there a some, though rare, false positives. But they are easily mitigated. These people are exactly that what they themselves are complaining about, elitist.
Yeah. Once you get used to the (verbose, but by no means unergonomic!) syntax, you’ll probably never be happy with another language again. Job-wise, I am currently mostly using Go, and while also a nice language, I miss the confidence and security I took for granted with rust.
Not to mention just how goddamn expressive rust can be. Let bindings like if ok/err, else return? Assign from a match on Some(Ok(x))? Filter, map, and friends on any iterator? Oh my GOD the error handling with the question mark iterator? 100% confidence that if it compiles, no error, possible null value, or case is unhandled.
And all this WHILE giving you the amazing security benefits!
Ah, damn, caught me proselytizing again.
Lol build something with serde and you’ll be hooked for life
Or a CLI with
clap.
Instructions unclear, now my car is falling apart
The human mind has limited capacity for things to pay attention to. If your attention is occupied with tiptoeing around the loaded guns scattered all over the floor, sooner or later you’ll slip and trip over one.
Of course, you’re a virtuoso programmer, so you can pirouette balletically around the floorguns as you deliver brilliantly efficient code. Which is great, until you have an off day, or you get bored of coding, run off to join the circus as a professional knife-juggler and your codebase is inherited by someone of more conventional aptitude.
Programming languages offering to keep track of some of the things programmers need to be aware of has been a boon for maintainability of code and, yes, security. Like type systems: there’s a reason we no longer write assembly language, squeezing multiple things into the bits of a register, unless we’re doing party tricks like demo coding or trying to push very limited systems to their limits.
… until you have an off day, or you get bored of coding, run off to join the circus as a professional knife-juggler and your codebase is inherited by someone of more conventional aptitude.
Sometimes you even have to deal with having mere mortals on your team!
Which is why garbage collection is the way to go.
It is a way to go but there are still cons there. Guaranteeing memory safety isn’t free. You have to pay for it somewhere, either at compilation time, like Rust, or during runtime like in Go. Both are solid approaches but GC will cause problems in cases where the extra runtime overhead is not acceptable.
“Should I use rust or c++” is the wrong question IMO. The right question is “do I want the code I run, written by thousands or millions of randos, to be written in rust or c++”.
Unlike you babies I have Personal Responsibility and I write all of my code directly in assembly the way reagan intended. I don’t need guard rails and I’ve never had any issues with it because my Personal Responsibility keeps me safe
Magnetised needle and a steady hand or gtfo
Skill issue takes are dumb as fuck. It’s just republican personal responsibility takes using different language.
Intelligent people focus on producing systemically better outcomes.
The problem with these followers of rust is that they’re heathens, disbelievers and worshippers of the devil. Just like all of you heretics. There is just one programming language for the true believer and it is FORTRAN. The pure and true FORTRAN, that is, which is punched into cards of virgin paper, not the heresy created by the blasphemy of 99.
I’m just trying to imagine installing something like modern Microsoft Office from punch cards. Getting the heavy bankers box from the closet. Spending a few hours feeding cards into the reader. Going on a profanity laced tirade because some idiot put them away out of order. It was
probablydefinitely me.I knew some people have, uh… “strange fantasies” - but installing Microsoft Office?! You really should see a psychiatrist.
…what a.godawful pervert!
C’s compiler prevents common type bugs and handles things like register allocation for you? So does skill.
While I do totally see the advantages of rust and agree skill is not a solution given people make mistakes…I do agree a lot of the very vocal rust advocates do act almost religious and it is an annoying turn off.
Do you have time to talk about our lord Rust? Did you know it died for our bugs so we don’t have to debug them at run time?
I’d guess it’s Rust fan’s genuine belief that they have something revolutionary.
“Rust’s compiler prevents common bugs” So does skill. No offense to you, but, this trope is getting so tiresome. If you like the language then go ahead and use it.
If you’re that much of a galaxybrain, you should be writing everything directly in opcodes. In reality, nobody is, and we invented languages to help us perform an activity the human brain is very poorly suited to.
This attitude also means that OP stares at their own obvious bugs on a screen all day and then decides they’re great, which is level of detachment from reality frightening to me.
Sadly, it is a detachment from reality that is entirely normal, even typical. In all walks of life.
What I still find surprising, even though normal, is how technical people can push actual facts and evidence right out of their world view.
Sure, 70% of the bugs in C++ code bases are memory rated according to multiple sources. So let me aggressively and confidently berate this idiot that says the Rust compiler is doing something useful.
You do not have to use either language to see how idiotic this is. Even if you accept that this guy has “the skill” to make compiler help redundant, he has no point at all unless he thinks that “typical” C++ users have that same level of skill. And, provably and trivially researched—they do not. Being this wrong makes him, as self-evidenced, incompetent by definition.
All he proves in the end is that he is angry (and I guess not a fan of Rust).
“Angry and incompetent” is sadly a much more common trope than the ones he tires off.
There’s some weird effects with language-specific bug rates.
In old Java, most uncaught exceptions are NullpointerExceptions, because most other exceptions used to be checked. Can’t not catch a checked exception.
So they made Kotlin, where NullpointerExceptions are the only type of checked exceptions. Now there are no unhandled NPEs anymore but now you get tons of other exceptions.
Oh yes, it’s so very human nature. But damn.
Most coders get the message at least a bit, I think. Other engineers have a reputation for massive egotism, software engineers don’t really.
Other engineers have a reputation for massive egotism, software engineers don’t really.
That’s a joke right?
Well, it’s possible I’m missing something, or that there’s a different reputation actually in the industry, since I’m an amateur. The first stereotypes I think of are unkempt, caffeine-dependent and socially inept.
When I’ve seen people asking for help online, traditional engineers seem much more likely to flex their credentials and then not actually answer. Although there’s definitely software examples as well.
“So does skill” I agree 100%
However, we’re human. You show me a skilled developer who never causes bugs, and I’ll show you a liar.
No matter how skilled or experienced a developer is, they always have the capacity to introduce a bug by accident.
Whether it’s a typo, or simply being tired or distracted, or just having one of those moments, or even one of those days. It’s completely normal.
Coding is just communication, and when working on larger codebases it can be just as nuanced as interpersonal communication. People miscommunicate every second of the day.
I’ve never used Rust.
Because most projects are worked on by multiple people, and you shouldn’t trust that everyone who will work on something will have the same skill level as you
If there are two languages otherwise equivalent in NFRs, where one lets you make the mistakes and the other doesn’t, you’re a bit silly if you don’t pick the latter.
Good engineers shouldn’t struggle to use a different language, so that’s not an argument
Everyone makes mistakes, no matter the level of skill
The really annoying part is all the people saying that you shouldn’t like Rust because actually it’s not magically bug free. Yeah, no shit. No one who touched Rust claims it lets you write bug free code. People like Rust because it’s modern, fast, has great tooling, great documentation and really nice features like Traits and Algebraic data types. Memory and thread safety is just a bonus.
Ammm actually… ☝️🤓 most Rust evengalists claim that Rust prevents you from writing bugs
It’s hard to argue with that statement. Like, literally, I have no idea who rust evangelists are, where to look for them and how to find out what “most” of them think about anything.
Yep - I don’t really know who these evangelists are either. I have read about “fearless concurrency,” which seems pretty spot-on.
Some bugs. I have never heard anybody remotely skilled in Rust claim that it prevents bugs in general.
Python prevents many classes of bugs too (compared to C++). And any statically typed compiler will prevent some bugs that Python allows. Not too controversial I hope. Of course, unlike Rust, Python is unsuitable for many C++ use cases for other reasons.
I do not use Rust and my self-image is not tied to C++. So I do not have to get upset when people explain the benefits of Rust.
Rust is not perfect. That is why I do not use it. But it is not some elaborate lie either. It was designed to do certain things, and it does.
Any type safe language will help you prevent a wide range of bugs that non safe languages need tons of tests to detect.
We’re talking about memory safety here, though.
Same argument though, just a different value for the topic.
Agreed. The C++ guys are basically JavaScript guys arguing that type safety errors are a skill issue. They must hate TyoeScript.
A real programmer only needs parentheses smdh
The language/compiler restricting some bad practices makes safer code with less skill. Btw, there’s also Safe C++











