|
-
April 21st, 2009, 05:05 PM
#16
Re: a = b; Help?
btw GCDEF you ever heard of a term called "friendship?"
wait lemme google it
-
April 21st, 2009, 06:09 PM
#17
Re: a = b; Help?
Of course not. We're computer nerds. None of us actually has any friends, just public interfaces.
-
April 21st, 2009, 06:49 PM
#18
Re: a = b; Help?
 Originally Posted by Lindley
Of course not. We're computer nerds. None of us actually has any friends, just public interfaces.
Besides, friends violate encapsulation.
-
April 22nd, 2009, 07:12 AM
#19
Re: a = b; Help?
 Originally Posted by EsX_Raptor
btw GCDEF you ever heard of a term called "friendship?"
wait lemme google it
This is a public programming forum. If you're just looking for a friend, perhaps Craigslist or match.com could hook you up.
-
April 22nd, 2009, 07:39 AM
#20
Re: a = b; Help?
sorry, but i'm not "just looking for a friend."
i just saw the guy is pretty new to C++ and wanted to be his friend because i like helping others.
if i was "just looking for a friend" I'd be hanging out with my peeps at this time.
-
April 22nd, 2009, 12:49 PM
#21
Re: a = b; Help?
 Originally Posted by Speedo
Besides, friends violate encapsulation. 
Not according to Bjarne. 
http://www.research.att.com/~bs/bs_faq2.html#friend
-
April 22nd, 2009, 05:48 PM
#22
Re: a = b; Help?
Surely just because it's explicit it doesn't mean that it doesn't violate it?
-
April 22nd, 2009, 08:20 PM
#23
Re: a = b; Help?
 Originally Posted by kempofighter
It was a bad joke based on a somewhat popular opinion. Hence the rolleyes smilie.
-
April 22nd, 2009, 09:04 PM
#24
Re: a = b; Help?
 Originally Posted by Mybowlcut
Surely just because it's explicit it doesn't mean that it doesn't violate it?
I'd like to see it that friend is there so you can "violate it" without "breaking it".
-
April 23rd, 2009, 12:00 AM
#25
Re: a = b; Help?
 Originally Posted by Lindley
None of us actually has any friends, just public interfaces.
I have some protected interfaces reserved for future children.
 Originally Posted by Mybowlcut
Surely just because it's explicit it doesn't mean that it doesn't violate it?
It depends. If you believe that member functions violate encapsulation, then it is reasonable for you to believe that friends violate encapsulation. Otherwise, it is a matter of degree: friends reduce encapsulation.
My recommended online reading list related to this topic:
How Non-Member Functions Improve Encapsulation - Meyers
Designing Simple Interfaces - Stroustrup
Monoliths "Unstrung" - Sutter
-
April 27th, 2009, 02:34 PM
#26
Re: a = b; Help?
 Originally Posted by Mybowlcut
Surely just because it's explicit it doesn't mean that it doesn't violate it?
Huh?
-
April 29th, 2009, 09:15 AM
#27
Re: a = b; Help?
iPirate:
The most fun part of learning to program is figuring stuff out yourself. Try changing things in the program and see how it affects your results. Like try changing the numbers, changing cout << d to cout << a etc. See what happens, and you can probably figure that stuff out yourself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|