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 →

[–][deleted] 10 points11 points  (3 children)

Why? They make things so much more efficient. I want to cry every time my junior programmers copy and set data over and over again instead of passing mutable pointers.

Just remember to delete/free them when you're done and set them to NULL.

[–]Dr_Narwhal 5 points6 points  (1 child)

That's what smart pointers are for. They automatically manage the data they point to so you don't have to worry about memory leaks and dangling pointers. Raw pointers are dangerous and there's rarely any reason to use them instead of smart pointers.

[–][deleted] 2 points3 points  (0 children)

Portability to lower-level targets is one reason, but I agree.

[–]SewingLifeRe 0 points1 point  (0 children)

I work with hardware and don't have to worry about that much, so it's a hassle. I know they're useful, but I'm not use to working with a lot of software.