306
My skill prevents bugs, unlike your fancy compiler, peasant.
(programming.dev)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
In summary: use rust.
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.
Classic example: A linked list
... are entirely possible, even if rarely the right choice.
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.
it always astounds me how utterly arrogant people are about their own abilities. (myself included) but seriously who the fuck doesnt like having something that just prevents you from doing things that are obviously broken and not going to work?
It’s like going to city hall and complaining your tax dollars are being spent on guardrails along the road that you haven’t personally ever driven into.
Which, for the record, people fully actually do.
Saw someone genuinely saying this about potholes yesterday
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:
https://xeiaso.net/blog/series/no-way-to-prevent-this/
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.
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
.