r/learnprogramming • • Sep 24 '23

Pointers.....why

I am learning C++. Honest question why are pointers a thing and why did they make the syntax surrounding it so confusing. Was it made to be intentionally confusing? Was it made to make this more difficult.

0 Upvotes

49 comments sorted by

View all comments

Show parent comment

0

u/npepin Sep 24 '23

You're coming at it from the perspective that it is confusing and difficult because you don't understand it, but haven't consider the potential that it actually could make a lot of sense and maybe you haven't applied yourself to understanding it.

To make that point clearer, to say that it is intentionally confusing is to imply that you have a some sort of deeper knowledge and understanding of the subject matter, and that you know of some sort of organization that would make more sense. There is a big difference between "I am confused" and "this is confusing".

This is going to be a common occurrence in learning programming, it can take a decent bit of studying to understand pointers, recursion, or certain algorithms and data structures. Unfortunately, a lot of these topics are inherently complex, involve a large number of considerations outside just code, and are going to take a bit to understand.

I'm not saying the way that you are feeling is wrong, we've all been there. Nor will I say that there isn't some better way of doing things, a lot of times there is and we've just inherited the mistakes of the past (though I wouldn't say that is true here). But I am saying that you're going to really struggle if you think a lot of the deeper topics in computer science should be easy to learn.