Fun with pointers in C++
-
C3D1 wrote:
Returning references would make it much harder to read
We'll just have to agree to disagree on that. IMO, this is a quite useful C++ paradigm.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
-
Daniel Pfeffer wrote:
IMO, this is a quite useful C++ paradigm.
...and that makes me even happier to barely being able to read C++ :laugh:
De gustibus non est disputandum :)
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
-
De gustibus non est disputandum :)
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
-
That's what I like about this forum. You go in thinking programming and you get a bit of Latin training. Hope I remember what the phrase means next time I see it.
Me too. There are plenty of sites around that merely answer programming questions, but only a few with the range of highly intelligent, humorous, and opinionated contributors that you find here. Amazingly, the amount of sniping and backbiting is kept to a minimum! Long may it last!
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
-
Me too. There are plenty of sites around that merely answer programming questions, but only a few with the range of highly intelligent, humorous, and opinionated contributors that you find here. Amazingly, the amount of sniping and backbiting is kept to a minimum! Long may it last!
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
-
Me too. There are plenty of sites around that merely answer programming questions, but only a few with the range of highly intelligent, humorous, and opinionated contributors that you find here. Amazingly, the amount of sniping and backbiting is kept to a minimum! Long may it last!
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
-
In two hours you can have a great lunch, jogging, some fun with your partner, some nice song listening/playing and also a shower. All that cannot be done because the language is cryptic: that's why I hate C/C++! Good post, though...
Mario Vernari wrote:
that's why I hate C/C++!
Yea, I kind of agree with that sentiment, however, I have yet to run across the language that will supply me with a great lunch, but I do admit to sometimes having fun with it. (Does that mean I'm cheating on my partner?)
-
In two hours you can have a great lunch, jogging, some fun with your partner, some nice song listening/playing and also a shower. All that cannot be done because the language is cryptic: that's why I hate C/C++! Good post, though...
Mario Vernari wrote:
that's why I hate C/C++!
Yea, I kind of agree with that sentiment, however, I have yet to run across the language that will supply me with a great lunch, but I do admit to sometimes having fun with it. (Not C++ and does that mean I'm cheating on my partner?)
-
De gustibus non est disputandum :)
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
Daniel Pfeffer wrote:
De gustibus non est disputandum :)
I.e. C++ is the Durian (stinkfruit) in Software Development.
-
C3D1 wrote:
Returning references would make it much harder to read
We'll just have to agree to disagree on that. IMO, this is a quite useful C++ paradigm.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
I agree, but I definitely would not name such a function "GetA".
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
-
Sorry, that's not my code, an i cant change it. I just saw it in some code and where surprised what's that :D Returning references would make it much harder to read:
GetA() = GetB()
looks like What the hell? Assignment to a Function? :omg: :wtf:
You can't read C++ code without knowing the types. Who knows if equals was overridden, everything could happen. Even then you should read, GetA() return something, then operator = is called on this something.