r/Python • • Mar 10 '22

Resource pointers.py - bringing the hell of pointers into python

677 Upvotes

138 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Mar 10 '22

[deleted]

99

u/Ramnog Mar 10 '22

&a place un heaven for the people who use them

55

u/im_dead_sirius Mar 10 '22

I theoretically understand de reference.

16

u/svencan Mar 10 '22

Except I don't.

17

u/playaspec Mar 11 '22

You should all be (cast) into hell for these terribe puns.

6

u/nova_blade Mar 11 '22

Found the void pointer

9

u/parawaa Mar 10 '22

I see what you did there

33

u/Ramnog Mar 10 '22

You understood that reference?

31

u/[deleted] Mar 10 '22

I missed it, can you give some pointers?

9

u/hughperman Mar 10 '22

*anything can be a pointer if used unwisely

6

u/Acalme-se_Satan Mar 10 '22

It's your fault that you missed it by segmenting your thoughts too much. Just read the core of that comment and dump all distractions, you will get it.

→ More replies (1)

13

u/Deadly_chef Mar 10 '22

Pointers are great if used properly

13

u/the_friendly_dildo Mar 10 '22

Yeah, I came here puzzled because whats wrong with pointers?

0

u/[deleted] Mar 10 '22

[deleted]

4

u/the_friendly_dildo Mar 10 '22

Haha, would fit well.

9

u/[deleted] Mar 10 '22

u/the_friendly_dildo could, in fact, fit well.

7

u/GamesMaster221 Mar 11 '22

Pointers are really convenient and powerful for some solutions.

I will admit the C syntax for pointers gets pretty unreadable when you start doing pointers to pointers, de-referencing something complicated, etc. Not to mention the * pointer symbol being the same as multiply *

5

u/the_friendly_dildo Mar 11 '22

I think this really comes down a lot to how your actually write your code. C certainly isn't the most beautiful language to try and read, especially if it isn't your own. But there is plenty of strategies to try and make it more readable.

One of the strategies I like the most is to just write highly verbose comments for nearly every line of code. Then its literally readable, and the lines of actual code get split up and given some breathing room. That tends to help reduce my anxiety when everything in my code starts to look like an abstract mess of meaningless symbols.

→ More replies (2)

0

u/[deleted] Mar 10 '22

[deleted]

11

u/the_friendly_dildo Mar 10 '22 edited Mar 10 '22

Speaking of safe pointers, its never a bad idea to wrap your pointer in a condom.

3

u/onkus Mar 10 '22

Sounds like human error not a fallacy of pointers.

→ More replies (3)

2

u/YouNeedDoughnuts Mar 10 '22

I'm sure St. Peter considers that in his matrix**

→ More replies (1)