value of pointer 0x0

0
318

I’ve been hearing this a lot lately, especially as of late. I’ve heard this phrase used a lot since I’ve been using C++ to develop for over a decade now. People tell me that I should stop using pointers and use values instead. I’ve always made an effort to use value types, but I’ve always thought that every programmer should stop using pointers and start using value types. Well, I’ve had enough. I’m going to stop using pointers to begin with.

Well, you can’t really have a value type without pointers, for starters, so no, you shouldn’t use pointers. And you shouldn’t use pointers that you don’t have to use. It’s a waste, a performance killer, and a security risk. I know I’m not using pointers a lot, but I still do. I just don’t use pointers that I have to use. If you don’t have to use the pointer, you should.

As it turns out, there are more than one way to get a pointer for every class you have in your class hierarchy. If you’re like me that’s your problem and its going to get bigger and bigger. Well, you should stop using pointers because its a waste, and a performance killer, and a security risk.

The problem is that I have no idea how many other people use pointers, or if they actually use them. The most common usage I see is if you have a specific class that you want to use to keep track of your objects. I know this because I have a class called View, that I use every time I make a new class call.

I don’t know how many people have used it, but the fact is that it’s a matter of opinion. So I guess I’m just going to go ahead and go ahead and tell myself, “I got it.

I think you can safely remove the word “most” from the previous sentence. I do not believe that every programmer uses pointers to their own objects. I believe that some uses pointers to keep track of specific objects, and just in general, I believe that many programmers use pointers to their own objects, but they don’t always use them correctly.

I see a link between using pointers not to have to go through the trouble of manually creating all of the objects and then manually assigning pointers to them, and also the issue of manually setting the value of a pointer variable. I have no issue with the second of these. I do think that the value of a pointer variable is defined by how the function used to dereference it is called.

When the developer uses the value of an object pointer, their function will be called which is, in turn, called by the developer. Their function is not called. A function call is not called. If you call a function in the context of a class and then pass that pointer to a function, they will be called.

I’m not even sure that this is a good way to put it.

I was initially confused because you were saying that the value of a pointer variable is defined by how the function used to dereference it is called. But I understand now that you’re saying they’re called by the developer.

LEAVE A REPLY

Please enter your comment!
Please enter your name here