this post was submitted on 21 Jul 2025
279 points (97.6% liked)

Programmer Humor

25425 readers
988 users here now

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.

Rules

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] calcopiritus@lemmy.world 26 points 1 week ago (14 children)

I kinda disagree. The reason rust caught on is because it is much safer than C++ while having the same or even better performance. And in some contexts, being garbage collected means bad performance.

Before rust you could either have a fast language (C/C++) or a memory safe language (any other language. That is, languages with garbage collector). But if you required memory safety and peak performance, there wasn't any option.

Yes, the reason that rust is both memory safe and fast is because it has a borrow checker. But the borrow checker is the means, not the end.

[–] AnyOldName3@lemmy.world 9 points 1 week ago (10 children)

Garbage collection doesn't guarantee memory safety and it's perfectly possible to create a memory-safe language without garbage collection. There are plenty of garbage collectors for C++ (and until C++23, support for garbage collection was part of the standard, although no one implemented it), and languages like C# let you interact with garbage-collected objects in unsafe blocks.

[–] Decq@lemmy.world 13 points 1 week ago (2 children)

Exactly, if garbage collection meant memory safety then why do we get null pointer exceptions about every 5 minutes in Java. Garbage collection is about memory leaks, not safety. Imho the borrow checker is a better solution than garbage collection and faster to boot.

[–] zea_64@lemmy.blahaj.zone 4 points 1 week ago

A null pointer exception is technically memory safe, you can get equivalent behavior with .unwrap() on an Option in Rust.

load more comments (1 replies)
load more comments (8 replies)
load more comments (11 replies)