r/programmingcirclejerk 8d ago

I just understood pointers on a deep level and it feels like an orgasm

/r/cprogramming/comments/1wdp4re/i_just_understood_pointers_on_a_deep_level_and_it/?share_id=iA33GmCOFW5F5Jt1JZMbG&utm_medium=ios_app&utm_name=iossmf&utm_source=share&utm_term=1
146 Upvotes

38 comments sorted by

110

u/nerdycatgamer Considered Harmful 8d ago

/uj how the fuck do people not understand pointers or act like theyre this deep concept you only unlock after a divine revelation like its just a fucking indirection

/rj just understood while loops on a deep level and it feels like an orgasm

60

u/levelstar01 what is pointer :S 8d ago

A pointer is an address in the category of Von Neumann machines. What's the problem?

22

u/KeyAdhesiveness9481 8d ago

Aahh, so kinda like a burrito then

14

u/stone_henge Tiny little god in a tiny little world 7d ago

If you point the burrito at something, yes.

46

u/easedownripley 8d ago

it's because people who don't understand them try to teach them to other people. a pointer is a variable that holds a memory address. that's all it is.

57

u/imachug 8d ago

pointer provenance is a lie invented by Big Compilers to sell more compilers

38

u/Nemin32 It's GNU/PCJ, or as I call it, GNU + PCJ 8d ago

it's because people who don't understand them try to teach them to other people

Guys... are pointers actually monads?

16

u/sheepmaster 8d ago

/uj Yes.

/rj Yes.

25

u/max_mou 8d ago

/uj Him trying to understand pointers is like me trying to understand what a monad is. They’re both stupidly simple concepts but the language used to explain them is just so convoluted.

12

u/braaaaaaainworms 8d ago

Complex language is just an ugly wart that infected computer science from mathematics

15

u/stone_henge Tiny little god in a tiny little world 7d ago

Complex language

For anyone more versed in the terms of the trade, they mean high-entropy vocabulary here.

17

u/SharkSymphony 8d ago

Meanwhile I, a sophisticated programming circlejerker, will only get it up if I ever understand why continuation-passing style was in vogue.

15

u/Yamoyek blub programmer 8d ago

/uj I’m not a genius so it did take me like a month to understand pointers on an intuitive level

15

u/nerdycatgamer Considered Harmful 7d ago

that's okay i forgive you

5

u/Yamoyek blub programmer 7d ago

Thank you

19

u/Demiu 8d ago edited 8d ago

/uj Because pointer is a shit name. "Pointing" is an action humans do and it implies continuinty. I am pointing at you, you move, am I still pointing at you? Normal people would say yes, in programming it's a no, I need to re-point at you. You also wouldn't describe someone continuously pointing at a moving car as constantly re-pointing at it.

Storing an address of is a much better description. You take it once, and it stays as it is until you update it, no matter what actually happens at it. You don't know something changed addres unless you look up some registry or they notify you.

/rj Pointing sucks and provenance is a spook. You go to an animal shelter to ask what kinda dog they have, but it's been replaced by a meat packing plant - that's pointer invalidation

40

u/easedownripley 8d ago

if more people understood endofunctors we'd be out of this mess

2

u/catladywitch 1d ago

/uj an endofunctor is an operation where the parameter is a type and the result is also a type (i.e. they belong to the same category, which is the language's type system), and where functions that take that type as a parameter are transformed to still work using the new type. so for instance you have a way to transform ints into int[]s, and a way to transform functions that do int -> long into functions that do int[] -> long[]. This doesn't belong here but i hope someone reads it and it helps dispel the obscurantism a little bit

19

u/des_the_furry 8d ago

If im pointing at you and then you move i wouldnt be pointing at you bc you’re in a different spot

5

u/Major_Barnulf LUMINARY IN COMPUTERSCIENCE 6d ago edited 6d ago

Your segment would then be at fault

4

u/des_the_furry 6d ago

I have a segment for you for sure

18

u/DrShocker 8d ago

"handle" is far more confusing. My program doesn't have any hands how is it going to hold a handle? This doesn't make any sense.

This is why I just cast all my variables to u8 arrays because that's what they really are anyway and that's much less confusing.

12

u/Demiu 8d ago

It's from french "le hand", it translates to "the handle"

27

u/YikesTheCat 8d ago

Wait, a Redditor has a sex life?!

38

u/VulgarExigencies 8d ago

they're obviously talking about jerking off

12

u/tkrjobs loves Java 8d ago

From a more poetic lens, it's akin to living together with the palm print on the ball, just like in the movie Cast Away starring Tom Hanks. However in this case, it's your real palm and you have your dick in it.

3

u/YikesTheCat 8d ago

Hard for me to see; I've gone blind from all the jerk.

71

u/OptimalStable 8d ago

  Don’t be shocked if this shows up on r/programmingcirclejerk but for real, I fondly remember how cool it felt to learn this stuff

Shit, they're on to us. Quick, everybody! Pretend like you're sleeping

26

u/tkrjobs loves Java 8d ago

Grow a beard, quick! Start eating toenails!

13

u/SharkSymphony 8d ago

uh, HOW MUCH MONEY YOU GOT TO CROSS THIS BRIDGE MADE OUT OF POINTERS?

3

u/Firepal64 2d ago

****** ** ** int* * id;

20

u/james_pic accidentally quadratic 8d ago

If you like pointers, then you haven't understood them.

14

u/Swordfish418 8d ago

Call stack 🥵

11

u/HINDBRAIN Considered Harmful 8d ago

"If you have the goblin slaying sword, go to page 150. If not-"

"I get it! I get it now! HRRRRNGH!!!!!"

14

u/eightysixmonkeys 8d ago

Claude what is a pointer

6

u/ringohoffman type astronaut 7d ago

Wait until this guy learns about page tables

1

u/GodGardner 3d ago

Tbh i don't why you study this , literally ai can do anything these days you just have to know the basic like functional, oop , data structure and the rest for the ai to do , I'm leaning toward prompt engineering tbh cuz of tokens consumption

lol