My skill prevents bugs, unlike your fancy compiler, peasant.
-
I've never run into a Java evangelist. Every opinion I've ever heard about Java is something like "Yeah, this sucks". I always thought that people put up with it because it's write-once, run-anywhere, but so is, y'know, Python.
I love Java
-
"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?
The "common bugs" that the Rust compiler prevents are those a good programmer should not make in the first place. It's the bugs that even evade a seasoned programmer that poses the problems, and there, Rust won't help either.
Remember ADA? A programming language frankesteined by a committee to make programming safer? The programmers using it still produce bugs. And ADA is way more whips and chains than Rust.
-
The "common bugs" that the Rust compiler prevents are those a good programmer should not make in the first place. It's the bugs that even evade a seasoned programmer that poses the problems, and there, Rust won't help either.
Remember ADA? A programming language frankesteined by a committee to make programming safer? The programmers using it still produce bugs. And ADA is way more whips and chains than Rust.
wrote last edited by [email protected]It's the bugs that even evade a seasoned programmer that poses the problems, and there, Rust won't help either
What do you mean these are not the ones that rust tries to fix? Even huge projects like the linux kernel get memory bugs. I don't know anything about ADA and nor do I want to "evangelize rust" but what you're saying sounds boggers.
Obviously rust cannot prevent all bugs or even most of them. It can only prevent a small subset of bugs, but saying that that "small subset of bugs" wouldn't happen to seasoned programmers is just wrong, especially when you have tons of programmers working on the same big project.
I don't mean to say that rust is always the correct choice, but that you're waving off its greatest offering as bicycle training wheels (i.e. something no seasoned programmer would need)
-
It's the bugs that even evade a seasoned programmer that poses the problems, and there, Rust won't help either
What do you mean these are not the ones that rust tries to fix? Even huge projects like the linux kernel get memory bugs. I don't know anything about ADA and nor do I want to "evangelize rust" but what you're saying sounds boggers.
Obviously rust cannot prevent all bugs or even most of them. It can only prevent a small subset of bugs, but saying that that "small subset of bugs" wouldn't happen to seasoned programmers is just wrong, especially when you have tons of programmers working on the same big project.
I don't mean to say that rust is always the correct choice, but that you're waving off its greatest offering as bicycle training wheels (i.e. something no seasoned programmer would need)
but what you’re saying sounds boggers.
Believe me, it isn't. I program about anything for forty+ years now. I probably have forgotten more programming languages than you can list, and if there are constants in programming, then a) while compilers get better at catching bugs, they never got over the basics, and b) a good programmer will alyways be better at preventing and catching bugs than a compiler.
Once you have aquired a good mindset about disciplined programming, those buglets a compiler (or even code review systems) can find usually don't happen. Be wary of those bugs that evade the seasoned programmer, though...
For the mindset, it is good to read and understand things like the MISRA standard. Stuff like that prevents bugs.
-
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
wrote last edited by [email protected]Magnetised needle and a steady hand or gtfo
-
but what you’re saying sounds boggers.
Believe me, it isn't. I program about anything for forty+ years now. I probably have forgotten more programming languages than you can list, and if there are constants in programming, then a) while compilers get better at catching bugs, they never got over the basics, and b) a good programmer will alyways be better at preventing and catching bugs than a compiler.
Once you have aquired a good mindset about disciplined programming, those buglets a compiler (or even code review systems) can find usually don't happen. Be wary of those bugs that evade the seasoned programmer, though...
For the mindset, it is good to read and understand things like the MISRA standard. Stuff like that prevents bugs.
I probably have forgotten more programming languages than you can list, and if there are constants in programming, then a) while compilers get better at catching bugs, they never got over the basics, and b) a good programmer will alyways be better at preventing and catching bugs than a compiler.
I agree with this
Once you have aquired a good mindset about disciplined programming, those buglets a compiler (or even code review systems) can find usually don't happen.
I also agree with this.
I would like to put a lot of emphasis in the usually. It doesn't mean that they don't happen, no human being makes no mistakes. Rust simply gives people a little more peace of mind knowing that unless they use unsafe they're probably fine in terms of memory issues.
As a side note, there was this once I was making an ecs engine in rust, and kept fighting the compiler on this issue. Specifically, the game engine bevy uses
Query
in theWorld
to retrieve information about the game state, and I wanted to do the same. For instance, in the following function (or something similar, I honestly don't remember all that well):fn getplayer(player: Query<Player>) {}
Would get player from the world and assign it to player (more or less). However rust was adamant in not letting me do this. After some thinking I finally realized why
fn getplayer(player: Query<Player>, player_too: Query<Player>) {}
Would give two mutable references to the same
Player
in the same function, which can be very easily mishandled, and thus is not allowed in rust.I don't know about the MISRA standard, but I don't think that using it would have changed the way I coded my inherently flawed approach. This is a small example, one that didn't even matter that much in the grand scheme of things and could be even hard to understand why it's bad without knowing rust, but it is the one that came to mind. I think that if I had more experience I would he able to give you one that actually had security implications.
I'm no seasoned programmer, however
-
I've never run into a Java evangelist. Every opinion I've ever heard about Java is something like "Yeah, this sucks". I always thought that people put up with it because it's write-once, run-anywhere, but so is, y'know, Python.
Early on, Java was advertized as the next great thing, ending headaches from system development, porting, and "promoting good programming practices through OOP".
Then people increasingly got tired of OOP and the speed penalty of both that paradigm and the JVM, not to mention more and more education institutes started to claim Java was too hard for beginners, and that Python would be better.
Now we have Rust evangelists promoting the language as the next great thing, ending headaches from memory safety issues, porting (if you target WASM and pack your app into a Chromium instance), and "promoting good programming practices through FP".
Time is truly a flat circle...
-
I think a bunch of C programmers hate rust passionately because they always looked down their noses at principled languages for being slow.
Now a principled language is beating them on both speed and safety and it's as if the jocks lost a baseball game to the nerds who studied dynamics of solids and cut a series of little slots in their bats so that every time they hit the ball it went out of the park.
So much hate for the clever win over the brute force.
Rust is a tiny bit slower in benchmarks with similar implementations, since it has a few more runtime checks, but the difference is minor.
-
The "common bugs" that the Rust compiler prevents are those a good programmer should not make in the first place. It's the bugs that even evade a seasoned programmer that poses the problems, and there, Rust won't help either.
Remember ADA? A programming language frankesteined by a committee to make programming safer? The programmers using it still produce bugs. And ADA is way more whips and chains than Rust.
I think I found your picture. Is it this one?
-
What's actually tiresome is how this keeps happening: https://paulgraham.com/avg.html
Great read
-
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?
-
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.
Classic example: A linked list
-
I've never run into a Java evangelist. Every opinion I've ever heard about Java is something like "Yeah, this sucks". I always thought that people put up with it because it's write-once, run-anywhere, but so is, y'know, Python.
I love Java and use it every chance I get
-
but what you’re saying sounds boggers.
Believe me, it isn't. I program about anything for forty+ years now. I probably have forgotten more programming languages than you can list, and if there are constants in programming, then a) while compilers get better at catching bugs, they never got over the basics, and b) a good programmer will alyways be better at preventing and catching bugs than a compiler.
Once you have aquired a good mindset about disciplined programming, those buglets a compiler (or even code review systems) can find usually don't happen. Be wary of those bugs that evade the seasoned programmer, though...
For the mindset, it is good to read and understand things like the MISRA standard. Stuff like that prevents bugs.
wrote last edited by [email protected]Man hackers would love you. Memory vulnerabilities are still one of if not the main cause of vulnerabilities in unsafe languages. Yes this even applies to large projects ran by experienced and skilled people like the Linux kernel. Stop thinking your the exception, because I guarantee you aren't but even if you were you can't read all of the code in the world in your lifetime. Nor can you write all the code in the world.
-
"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?
At my last job I worked in a code base written in C and it needed to be certified to MISRA level A, and even in a language with as many foot guns as C, it's possible to write safe code. You just need to know what you're doing. I know there are tons of Rust zealots out there claiming it'll solve every last problem, but it turns out you just need to be careful.
-
Classic example: A linked list
... are entirely possible, even if rarely the right choice.
-
... are entirely possible, even if rarely the right choice.
wrote last edited by [email protected]With unsafe, but how can you write a double linked list in safe rust? (without indices)
-
"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?
I can sympathize with some people getting tired of "rewrite it in Rust", especially when it's suggested inappropriately. (Worst I saw was an issue opened on something, maybe a database, I don't remember. Someone said they were a new programmer and wanted to help and only knew a little Rust and that if the project was rewritten in Rust they could help.) But... Rust's compiler being able to do those things is actually super useful and amazing. This is like someone saying they don't need static types because they know the language good enough to not misuse the dynamic types. This is like someone saying they don't need C because they're good at assembly.
While it isn't something as simple as Rust being strictly better than C/C++, it's really silly to say that you being a good developer means you don't need guardrails. Everybody makes mistakes all the time. You're not perfect.
-
Other engineers have a reputation for massive egotism, software engineers don’t really.
That's a joke right?
wrote last edited by [email protected]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.
-
At my last job I worked in a code base written in C and it needed to be certified to MISRA level A, and even in a language with as many foot guns as C, it's possible to write safe code. You just need to know what you're doing. I know there are tons of Rust zealots out there claiming it'll solve every last problem, but it turns out you just need to be careful.
wrote last edited by [email protected]it turns out you just need to be careful
Famous last words