548
Pointers explained: (thelemmy.club)
you are viewing a single comment's thread
view the rest of the comments
[-] Sylvartas@lemmy.dbzer0.com 2 points 3 days ago* (last edited 3 days ago)

I want my language to pass by reference. I give a variable to a function and the variable in the function scope should be a reference to the same place in memory as the original variable.

I'm not even a C++ wizard or anything (though it's my most advanced language) so I'm not gonna argue that is good or bad, that sounds fine to me for a wide range of applications already.

But the way is see it, pointers kinda allow you to use "raw memory" which is an actual thing that's gonna be handled by the program one way or another, and it's a way to relatively refer to memory for example. As some guy on stackoverflow put it "That guy at the end for the bar" vs "Bob" can be very useful. Especially when using data structures you don't know the size of at compile time.

[-] captcha_incorrect@lemmy.world 2 points 1 day ago

I had to implement drag and drop in a Windows application recently. Since you don't know the content type nor the size of the content, pointers has to be used, which makes sense. For the most part when working within the bounds of my own application, I haven't found a good use case for pointers. That could of course be because I am not used to thinking in that way.

this post was submitted on 08 Jun 2026
548 points (94.5% liked)

Programmer Humor

31787 readers
34 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 3 years ago
MODERATORS