CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27

Thread: a = b; Help?

  1. #16
    Join Date
    Apr 2009
    Posts
    21

    Re: a = b; Help?

    btw GCDEF you ever heard of a term called "friendship?"

    wait lemme google it

  2. #17
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: a = b; Help?

    Of course not. We're computer nerds. None of us actually has any friends, just public interfaces.

  3. #18
    Join Date
    Aug 2007
    Posts
    858

    Re: a = b; Help?

    Quote Originally Posted by Lindley View Post
    Of course not. We're computer nerds. None of us actually has any friends, just public interfaces.
    Besides, friends violate encapsulation.

  4. #19
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: a = b; Help?

    Quote Originally Posted by EsX_Raptor View Post
    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.

  5. #20
    Join Date
    Apr 2009
    Posts
    21

    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.

  6. #21
    Join Date
    Aug 2005
    Location
    San Diego, CA
    Posts
    1,054

    Re: a = b; Help?

    Quote Originally Posted by Speedo View Post
    Besides, friends violate encapsulation.
    Not according to Bjarne.
    http://www.research.att.com/~bs/bs_faq2.html#friend

  7. #22
    Join Date
    Nov 2006
    Location
    Australia
    Posts
    1,569

    Re: a = b; Help?

    Surely just because it's explicit it doesn't mean that it doesn't violate it?
    Good judgment is gained from experience. Experience is gained from bad judgment.
    Cosy Little Game | SDL | GM script | VLD | Syntax Hlt | Can you help me with my homework assignment?

  8. #23
    Join Date
    Aug 2007
    Posts
    858

    Re: a = b; Help?

    Quote Originally Posted by kempofighter View Post
    It was a bad joke based on a somewhat popular opinion. Hence the rolleyes smilie.

  9. #24
    Join Date
    Apr 2009
    Location
    Netherlands
    Posts
    91

    Re: a = b; Help?

    Quote Originally Posted by Mybowlcut View Post
    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".

  10. #25
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: a = b; Help?

    Quote Originally Posted by Lindley
    None of us actually has any friends, just public interfaces.
    I have some protected interfaces reserved for future children.

    Quote 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
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  11. #26
    Join Date
    Aug 2005
    Location
    San Diego, CA
    Posts
    1,054

    Re: a = b; Help?

    Quote Originally Posted by Mybowlcut View Post
    Surely just because it's explicit it doesn't mean that it doesn't violate it?
    Huh?

  12. #27
    Join Date
    Feb 2007
    Posts
    43

    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.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured