r/ProgrammerHumor • • Nov 23 '17

"How to learn programming in 21 Days"

Post image
29k Upvotes

534 comments sorted by

View all comments

Show parent comment

12

u/kbroaster Nov 23 '17

Pointers are something that a lot of people struggle with. Usually, the next generation of languages handle all the complicated tasks, e.g. memory management, so you can't do the stuff you can do with C++. It's a powerful language, but it has a lot of aspects that people struggle with, e.g. templates. In general, most people struggle with nested loops and datatypes, but with C and C++ there are even more complex interactions that people can't seem to grasp.

9

u/biggustdikkus Nov 23 '17

Once you get used to pointers, then it feels really limiting not being able to use it.

1

u/Klaue Nov 23 '17

are autopointers finally in the standard? you had to use boost for them back then

7

u/[deleted] Nov 23 '17

Day 1: Start learning C++.

Day 19: You think it's going reasonably well. You might actually get through this.

Day 20: You come across pointers. You kill yourself.

1

u/gauderio Nov 23 '17

I had to emulate inheritance with C in the early 90's using pointers to functions. Lived in a secluded place and didn't know about C++. When I learned C++ I thought I was in heaven.

Then I had to unlearn a bunch of bad habits from C. Thinking in classes is way different than calling functions, and it's way easier to avoid globals.

Also, for both C and C++, pointer arithmetic is how you slowly make your code unshippable. Besides been hard to maintain, it creates a breeding ground for security bugs. There be dragons.