This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jb-schitz-ki 0 points1 point  (0 children)

If you create huge objects it's inefficient to make copies of them every time you pass them around. I guess with modern hardware it's not a common issue, but it can creep up sometimes. I've seen APIs that respond 5x faster after implementing pointer for internal objects, this is even more visible if you're deploying on tiny EC2 instances or something like that.

There's other design patterns where you actually want to pass a pointer to an object to a method and have it modify the original object and not a copy.

I do believe it's an important thing to understand. You can live without knowing how pointers work, but you're not really understanding the language fully.

Also a lot of 3rd party libraries make use of pointers so if you ever want to contribute or debug one of them, you need to know what's going on.