313
submitted 4 days ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 2 points 1 day ago* (last edited 1 day ago)

Yes, pretty much like UML diagrams. Who is responsible for allocating memory and freeing it.

Languages like Swift, Objective-C, C++ have features that mean you don’t need to do this by hand. But you have to tell the compiler if you want to keep and object around and who owns it.

See this article on Objective-C to see the different ways to manage memory this language supports.

[-] [email protected] 1 points 16 hours ago

Ah, interesting. I went from garbage-collected languages where thinking about ownership might be useful for keeping complexity low and occasionally comes up when you manage lists of objects, but ultimately isn't needed, to Rust where well-defined ownership is enforced by the language.

So, I wasn't aware that ownership is even as concrete of a thing in other languages...

[-] [email protected] 1 points 5 hours ago

Oh you need this in garbage collected languages too, once you run into memory use issues. GC languages are notorious for being wasteful with memory, even when working correctly.

this post was submitted on 05 Jul 2025
313 points (99.1% liked)

Programmer Humor

24874 readers
995 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