this post was submitted on 16 Sep 2025
235 points (96.8% liked)

Programmer Humor

26373 readers
1624 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
[–] firelizzard@programming.dev 1 points 7 hours ago (2 children)

Garbage collection is analyzing the heap and figuring out what can be collected. Reference counting requires the code to increment or decrement a counter and frees memory when the counter hits zero. They’re fundamentally different approaches. Also reference counting isn’t necessarily automatic, Objective-C had manual reference counting since day one.

[–] BatmanAoD@programming.dev 3 points 3 hours ago

"Garbage collection" is ambiguous, actually; reference counting is traditionally considered a kind of "garbage collection". The type you're thinking of is called "tracing garbage collection," but the term "garbage collection" is often used to specifically mean "tracing garbage collection."

[–] CanadaPlus@lemmy.sdf.org 2 points 5 hours ago

It's still mentioned as one of the main approaches to garbage collection in the garbage collection Wikipedia article.