why C# doesn't support "friend" relationship?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zeng

    why C# doesn't support "friend" relationship?


    It's so messy w/o the "friend" relationship. Does anyone know why it was
    not supported in C#. It's almost about as bad as it doesn't support the
    inheritance hierarchy and method reference (calling tree) browsing that is
    supported in C++. I don't know how some could write a large scale
    object-oriented application w/o those. If you have overcome these
    limitations in C#, please share your thoughts and ideas. Thanks!




  • Richard

    #2
    why C# doesn't support "friend&qu ot; relationship?


    1) Friend is not so great in and of itself, but that aside
    you have "internal" and "protected internal"...

    2) View/Class View from main menu and you can browse to
    your hearts content...
    [color=blue]
    >-----Original Message-----
    >
    >It's so messy w/o the "friend" relationship. Does anyone[/color]
    know why it was[color=blue]
    >not supported in C#. It's almost about as bad as it[/color]
    doesn't support the[color=blue]
    >inheritance hierarchy and method reference (calling tree)[/color]
    browsing that is[color=blue]
    >supported in C++. I don't know how some could write a[/color]
    large scale[color=blue]
    >object-oriented application w/o those. If you have[/color]
    overcome these[color=blue]
    >limitations in C#, please share your thoughts and ideas.[/color]
    Thanks![color=blue]
    >
    >
    >
    >
    >.
    >[/color]

    Comment

    • Jon Skeet

      #3
      Re: why C# doesn't support "friend&qu ot; relationship?

      Zeng <zzy@nonospam.c om> wrote:[color=blue]
      > It's so messy w/o the "friend" relationship. Does anyone know why it was
      > not supported in C#. It's almost about as bad as it doesn't support the
      > inheritance hierarchy and method reference (calling tree) browsing that is
      > supported in C++.[/color]

      Hang on - "browsing" sounds like it's something to do with the IDE, not
      with the language itself. Or have I misunderstood?
      [color=blue]
      > I don't know how some could write a large scale
      > object-oriented application w/o those. If you have overcome these
      > limitations in C#, please share your thoughts and ideas. Thanks![/color]

      Having not done much C++, I can't say there have been many times where
      I've thought, "Ah, what I really need here is friend access." Internal
      is usually fine - especially if you don't mind having a separate
      assembly for each subsystem in your app. Occasionally I've felt it
      would be nice to have a namespace access level, like package access in
      Java (although possibly without its implicit protected access), but
      that's been pretty rare.

      I can't say it's really been a barrier to writing C#.

      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      • John Smith

        #4
        Re: why C# doesn't support &quot;friend&qu ot; relationship?

        "In general, friend functions are frowned upon in C++ because it breaks the
        natural encapsulation. As a general rule, you should pick your friends with
        care, as you don't want just anyone tinkering with your private parts."



        "Zeng" <zzy@nonospam.c om> wrote in message
        news:%23gvR95ci DHA.3832@tk2msf tngp13.phx.gbl. ..[color=blue]
        >
        > It's so messy w/o the "friend" relationship. Does anyone know why it was
        > not supported in C#. It's almost about as bad as it doesn't support the
        > inheritance hierarchy and method reference (calling tree) browsing that is
        > supported in C++. I don't know how some could write a large scale
        > object-oriented application w/o those. If you have overcome these
        > limitations in C#, please share your thoughts and ideas. Thanks!
        >
        >
        >
        >[/color]


        Comment

        • 100

          #5
          Re: why C# doesn't support &quot;friend&qu ot; relationship?

          Hi Zeng,

          Even though, I miss *friend* once in a while I dont't thing that is a big
          loss.
          When you declare a type as inner of other type. The former is friend of the
          outer and has unlimited access to all memebers. Doesn't work the other way
          arround, though. I mostly used *friend* in c++ when I was overloading the
          operators with global functions. However, it is not the case with .NET.
          In addition you have *internal* access modifier.
          Actually I believe that *friend* methods could make the big mess if it is
          not used sparingly.

          About the second part of the question. Yes, you have all this in the *class
          viewer*. This is IDE feature and has nothing to do with C#, C++ or any other
          language, though.


          HTH
          B\rgds
          100
          [color=blue]
          > It's so messy w/o the "friend" relationship. Does anyone know why it was
          > not supported in C#. It's almost about as bad as it doesn't support the
          > inheritance hierarchy and method reference (calling tree) browsing that is
          > supported in C++. I don't know how some could write a large scale
          > object-oriented application w/o those. If you have overcome these
          > limitations in C#, please share your thoughts and ideas. Thanks![/color]


          Comment

          • Zeng

            #6
            Re: why C# doesn't support &quot;friend&qu ot; relationship?

            - Virtual protected internal methods trigger compiler warnings that we can't
            turn it off individually.
            - Class Resident has Police as a friend (in C++), if you put Police to the
            same assembly then it won't be able to be in the assemply with other classes
            like PoliceOffice
            - If i'm going to modify a core code (let's say a method), how do I use
            View/ClassView to find out quickly which code will be impacted by my
            changes? In C++ IDE, I would have to see who reference the method, who
            inherits the class, and most of the times who references it's overriden
            methods, and trace it along the inheritence hierarchy and sideway to other
            related methods. Right now, in C#, I would have to do a "find in files"
            operation for each single mouse click that I used to do with C++ IDE and
            still don't have the same overall relationship picture.
            -View/Class View doesn't tell who inherit your class, it only tell you who
            your class inherits.



            "Richard" <richardn@amgen .com> wrote in message
            news:09b701c389 d1$6648c0c0$a00 1280a@phx.gbl.. .[color=blue]
            >
            > 1) Friend is not so great in and of itself, but that aside
            > you have "internal" and "protected internal"...
            >
            > 2) View/Class View from main menu and you can browse to
            > your hearts content...
            >[color=green]
            > >-----Original Message-----
            > >
            > >It's so messy w/o the "friend" relationship. Does anyone[/color]
            > know why it was[color=green]
            > >not supported in C#. It's almost about as bad as it[/color]
            > doesn't support the[color=green]
            > >inheritance hierarchy and method reference (calling tree)[/color]
            > browsing that is[color=green]
            > >supported in C++. I don't know how some could write a[/color]
            > large scale[color=green]
            > >object-oriented application w/o those. If you have[/color]
            > overcome these[color=green]
            > >limitations in C#, please share your thoughts and ideas.[/color]
            > Thanks![color=green]
            > >
            > >
            > >
            > >
            > >.
            > >[/color][/color]


            Comment

            • Zeng

              #7
              Re: why C# doesn't support &quot;friend&qu ot; relationship?


              Because we only have 1 IDE (as least that I know of) available for C#, so
              practically the IDE limitation has everything to do with C#, and woud
              someone dare to develop their own IDE for C# to compete with MS? Or maybe MS
              will write another IDE for C++ users?


              "100" <100@100.com> wrote in message
              news:ejK12XdiDH A.2984@TK2MSFTN GP11.phx.gbl...[color=blue]
              > Hi Zeng,
              >
              > Even though, I miss *friend* once in a while I dont't thing that is a big
              > loss.
              > When you declare a type as inner of other type. The former is friend of[/color]
              the[color=blue]
              > outer and has unlimited access to all memebers. Doesn't work the other way
              > arround, though. I mostly used *friend* in c++ when I was overloading the
              > operators with global functions. However, it is not the case with .NET.
              > In addition you have *internal* access modifier.
              > Actually I believe that *friend* methods could make the big mess if it is
              > not used sparingly.
              >
              > About the second part of the question. Yes, you have all this in the[/color]
              *class[color=blue]
              > viewer*. This is IDE feature and has nothing to do with C#, C++ or any[/color]
              other[color=blue]
              > language, though.
              >
              >
              > HTH
              > B\rgds
              > 100
              >[color=green]
              > > It's so messy w/o the "friend" relationship. Does anyone know why it[/color][/color]
              was[color=blue][color=green]
              > > not supported in C#. It's almost about as bad as it doesn't support the
              > > inheritance hierarchy and method reference (calling tree) browsing that[/color][/color]
              is[color=blue][color=green]
              > > supported in C++. I don't know how some could write a large scale
              > > object-oriented application w/o those. If you have overcome these
              > > limitations in C#, please share your thoughts and ideas. Thanks![/color]
              >
              >[/color]


              Comment

              • Bobby C. Jones

                #8
                Re: why C# doesn't support &quot;friend&qu ot; relationship?

                I have no comments on comparing the two IDE's but there is an alternative to
                VC#.

                ICSharpCode has 20 repositories available. Follow their code on GitHub.

                --
                Bobby C. Jones


                "Zeng" <zzy@nonospam.c om> wrote in message
                news:%23HijDidi DHA.1880@tk2msf tngp13.phx.gbl. ..[color=blue]
                >
                > Because we only have 1 IDE (as least that I know of) available for C#, so
                > practically the IDE limitation has everything to do with C#, and woud
                > someone dare to develop their own IDE for C# to compete with MS? Or maybe[/color]
                MS[color=blue]
                > will write another IDE for C++ users?
                >
                >
                > "100" <100@100.com> wrote in message
                > news:ejK12XdiDH A.2984@TK2MSFTN GP11.phx.gbl...[color=green]
                > > Hi Zeng,
                > >
                > > Even though, I miss *friend* once in a while I dont't thing that is a[/color][/color]
                big[color=blue][color=green]
                > > loss.
                > > When you declare a type as inner of other type. The former is friend of[/color]
                > the[color=green]
                > > outer and has unlimited access to all memebers. Doesn't work the other[/color][/color]
                way[color=blue][color=green]
                > > arround, though. I mostly used *friend* in c++ when I was overloading[/color][/color]
                the[color=blue][color=green]
                > > operators with global functions. However, it is not the case with .NET.
                > > In addition you have *internal* access modifier.
                > > Actually I believe that *friend* methods could make the big mess if it[/color][/color]
                is[color=blue][color=green]
                > > not used sparingly.
                > >
                > > About the second part of the question. Yes, you have all this in the[/color]
                > *class[color=green]
                > > viewer*. This is IDE feature and has nothing to do with C#, C++ or any[/color]
                > other[color=green]
                > > language, though.
                > >
                > >
                > > HTH
                > > B\rgds
                > > 100
                > >[color=darkred]
                > > > It's so messy w/o the "friend" relationship. Does anyone know why it[/color][/color]
                > was[color=green][color=darkred]
                > > > not supported in C#. It's almost about as bad as it doesn't support[/color][/color][/color]
                the[color=blue][color=green][color=darkred]
                > > > inheritance hierarchy and method reference (calling tree) browsing[/color][/color][/color]
                that[color=blue]
                > is[color=green][color=darkred]
                > > > supported in C++. I don't know how some could write a large scale
                > > > object-oriented application w/o those. If you have overcome these
                > > > limitations in C#, please share your thoughts and ideas. Thanks![/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Jay B. Harlow [MVP - Outlook]

                  #9
                  Re: why C# doesn't support &quot;friend&qu ot; relationship?

                  Zeng,
                  Have you looked into Refactoring and some of the C# Refactoring tools?

                  Introduction to the technique of refactoring and online catalog of refactorings


                  See the .NET section for C# tools:


                  Refactoring is a technique to restructure code in a disciplined way.

                  What I have been doing in VB.NET is applying the Obsolete Attribute to the
                  element (method, class, field) that I intend on modifying, then I get a list
                  of warnings every place that element is used. I then proceed with the
                  Refactoring as normal.

                  Hope this helps
                  Jay

                  "Zeng" <zzy@nonospam.c om> wrote in message
                  news:ut3jHediDH A.2192@TK2MSFTN GP09.phx.gbl...[color=blue]
                  > - Virtual protected internal methods trigger compiler warnings that we[/color]
                  can't[color=blue]
                  > turn it off individually.
                  > - Class Resident has Police as a friend (in C++), if you put Police to the
                  > same assembly then it won't be able to be in the assemply with other[/color]
                  classes[color=blue]
                  > like PoliceOffice
                  > - If i'm going to modify a core code (let's say a method), how do I use
                  > View/ClassView to find out quickly which code will be impacted by my
                  > changes? In C++ IDE, I would have to see who reference the method, who
                  > inherits the class, and most of the times who references it's overriden
                  > methods, and trace it along the inheritence hierarchy and sideway to other
                  > related methods. Right now, in C#, I would have to do a "find in files"
                  > operation for each single mouse click that I used to do with C++ IDE and
                  > still don't have the same overall relationship picture.
                  > -View/Class View doesn't tell who inherit your class, it only tell you who
                  > your class inherits.
                  >
                  >
                  >
                  > "Richard" <richardn@amgen .com> wrote in message
                  > news:09b701c389 d1$6648c0c0$a00 1280a@phx.gbl.. .[color=green]
                  > >
                  > > 1) Friend is not so great in and of itself, but that aside
                  > > you have "internal" and "protected internal"...
                  > >
                  > > 2) View/Class View from main menu and you can browse to
                  > > your hearts content...
                  > >[color=darkred]
                  > > >-----Original Message-----
                  > > >
                  > > >It's so messy w/o the "friend" relationship. Does anyone[/color]
                  > > know why it was[color=darkred]
                  > > >not supported in C#. It's almost about as bad as it[/color]
                  > > doesn't support the[color=darkred]
                  > > >inheritance hierarchy and method reference (calling tree)[/color]
                  > > browsing that is[color=darkred]
                  > > >supported in C++. I don't know how some could write a[/color]
                  > > large scale[color=darkred]
                  > > >object-oriented application w/o those. If you have[/color]
                  > > overcome these[color=darkred]
                  > > >limitations in C#, please share your thoughts and ideas.[/color]
                  > > Thanks![color=darkred]
                  > > >
                  > > >
                  > > >
                  > > >
                  > > >.
                  > > >[/color][/color]
                  >
                  >[/color]


                  Comment

                  • Mr.Tickle

                    #10
                    Re: why C# doesn't support &quot;friend&qu ot; relationship?

                    no debugger, thts why that IDE sucks.


                    "Bobby C. Jones" <bobbyj (at) acadx (dot) com> wrote in message
                    news:uHDefGeiDH A.1048@TK2MSFTN GP11.phx.gbl...[color=blue]
                    > I have no comments on comparing the two IDE's but there is an alternative[/color]
                    to[color=blue]
                    > VC#.
                    >
                    > http://www.icsharpcode.net/
                    > --
                    > Bobby C. Jones
                    > http://code.AcadX.com
                    >
                    > "Zeng" <zzy@nonospam.c om> wrote in message
                    > news:%23HijDidi DHA.1880@tk2msf tngp13.phx.gbl. ..[color=green]
                    > >
                    > > Because we only have 1 IDE (as least that I know of) available for C#,[/color][/color]
                    so[color=blue][color=green]
                    > > practically the IDE limitation has everything to do with C#, and woud
                    > > someone dare to develop their own IDE for C# to compete with MS? Or[/color][/color]
                    maybe[color=blue]
                    > MS[color=green]
                    > > will write another IDE for C++ users?
                    > >
                    > >
                    > > "100" <100@100.com> wrote in message
                    > > news:ejK12XdiDH A.2984@TK2MSFTN GP11.phx.gbl...[color=darkred]
                    > > > Hi Zeng,
                    > > >
                    > > > Even though, I miss *friend* once in a while I dont't thing that is a[/color][/color]
                    > big[color=green][color=darkred]
                    > > > loss.
                    > > > When you declare a type as inner of other type. The former is friend[/color][/color][/color]
                    of[color=blue][color=green]
                    > > the[color=darkred]
                    > > > outer and has unlimited access to all memebers. Doesn't work the other[/color][/color]
                    > way[color=green][color=darkred]
                    > > > arround, though. I mostly used *friend* in c++ when I was overloading[/color][/color]
                    > the[color=green][color=darkred]
                    > > > operators with global functions. However, it is not the case with[/color][/color][/color]
                    ..NET.[color=blue][color=green][color=darkred]
                    > > > In addition you have *internal* access modifier.
                    > > > Actually I believe that *friend* methods could make the big mess if it[/color][/color]
                    > is[color=green][color=darkred]
                    > > > not used sparingly.
                    > > >
                    > > > About the second part of the question. Yes, you have all this in the[/color]
                    > > *class[color=darkred]
                    > > > viewer*. This is IDE feature and has nothing to do with C#, C++ or any[/color]
                    > > other[color=darkred]
                    > > > language, though.
                    > > >
                    > > >
                    > > > HTH
                    > > > B\rgds
                    > > > 100
                    > > >
                    > > > > It's so messy w/o the "friend" relationship. Does anyone know why[/color][/color][/color]
                    it[color=blue][color=green]
                    > > was[color=darkred]
                    > > > > not supported in C#. It's almost about as bad as it doesn't support[/color][/color]
                    > the[color=green][color=darkred]
                    > > > > inheritance hierarchy and method reference (calling tree) browsing[/color][/color]
                    > that[color=green]
                    > > is[color=darkred]
                    > > > > supported in C++. I don't know how some could write a large scale
                    > > > > object-oriented application w/o those. If you have overcome these
                    > > > > limitations in C#, please share your thoughts and ideas. Thanks!
                    > > >
                    > > >[/color]
                    > >
                    > >[/color]
                    >
                    >[/color]


                    Comment

                    • Eric Gunnerson [MS]

                      #11
                      Re: why C# doesn't support &quot;friend&qu ot; relationship?

                      We're considering adding some friend support in Whidbey.

                      "Zeng" <zzy@nonospam.c om> wrote in message
                      news:%23gvR95ci DHA.3832@tk2msf tngp13.phx.gbl. ..[color=blue]
                      >
                      > It's so messy w/o the "friend" relationship. Does anyone know why it was
                      > not supported in C#. It's almost about as bad as it doesn't support the
                      > inheritance hierarchy and method reference (calling tree) browsing that is
                      > supported in C++. I don't know how some could write a large scale
                      > object-oriented application w/o those. If you have overcome these
                      > limitations in C#, please share your thoughts and ideas. Thanks![/color]


                      Comment

                      • Bobby C. Jones

                        #12
                        Re: why C# doesn't support &quot;friend&qu ot; relationship?

                        I don't use it either. Just wanted to show that there were alternatives.
                        And that MS isn't stopping those that have the desire to try and outdo
                        them...
                        --
                        Bobby C. Jones


                        "Mr.Tickle" <MrTickle@mrmen .com> wrote in message
                        news:%235wTmUei DHA.1696@TK2MSF TNGP09.phx.gbl. ..[color=blue]
                        > no debugger, thts why that IDE sucks.
                        >
                        >
                        > "Bobby C. Jones" <bobbyj (at) acadx (dot) com> wrote in message
                        > news:uHDefGeiDH A.1048@TK2MSFTN GP11.phx.gbl...[color=green]
                        > > I have no comments on comparing the two IDE's but there is an[/color][/color]
                        alternative[color=blue]
                        > to[color=green]
                        > > VC#.
                        > >
                        > > http://www.icsharpcode.net/
                        > > --
                        > > Bobby C. Jones
                        > > http://code.AcadX.com
                        > >
                        > > "Zeng" <zzy@nonospam.c om> wrote in message
                        > > news:%23HijDidi DHA.1880@tk2msf tngp13.phx.gbl. ..[color=darkred]
                        > > >
                        > > > Because we only have 1 IDE (as least that I know of) available for C#,[/color][/color]
                        > so[color=green][color=darkred]
                        > > > practically the IDE limitation has everything to do with C#, and woud
                        > > > someone dare to develop their own IDE for C# to compete with MS? Or[/color][/color]
                        > maybe[color=green]
                        > > MS[color=darkred]
                        > > > will write another IDE for C++ users?
                        > > >
                        > > >
                        > > > "100" <100@100.com> wrote in message
                        > > > news:ejK12XdiDH A.2984@TK2MSFTN GP11.phx.gbl...
                        > > > > Hi Zeng,
                        > > > >
                        > > > > Even though, I miss *friend* once in a while I dont't thing that is[/color][/color][/color]
                        a[color=blue][color=green]
                        > > big[color=darkred]
                        > > > > loss.
                        > > > > When you declare a type as inner of other type. The former is friend[/color][/color]
                        > of[color=green][color=darkred]
                        > > > the
                        > > > > outer and has unlimited access to all memebers. Doesn't work the[/color][/color][/color]
                        other[color=blue][color=green]
                        > > way[color=darkred]
                        > > > > arround, though. I mostly used *friend* in c++ when I was[/color][/color][/color]
                        overloading[color=blue][color=green]
                        > > the[color=darkred]
                        > > > > operators with global functions. However, it is not the case with[/color][/color]
                        > .NET.[color=green][color=darkred]
                        > > > > In addition you have *internal* access modifier.
                        > > > > Actually I believe that *friend* methods could make the big mess if[/color][/color][/color]
                        it[color=blue][color=green]
                        > > is[color=darkred]
                        > > > > not used sparingly.
                        > > > >
                        > > > > About the second part of the question. Yes, you have all this in the
                        > > > *class
                        > > > > viewer*. This is IDE feature and has nothing to do with C#, C++ or[/color][/color][/color]
                        any[color=blue][color=green][color=darkred]
                        > > > other
                        > > > > language, though.
                        > > > >
                        > > > >
                        > > > > HTH
                        > > > > B\rgds
                        > > > > 100
                        > > > >
                        > > > > > It's so messy w/o the "friend" relationship. Does anyone know why[/color][/color]
                        > it[color=green][color=darkred]
                        > > > was
                        > > > > > not supported in C#. It's almost about as bad as it doesn't[/color][/color][/color]
                        support[color=blue][color=green]
                        > > the[color=darkred]
                        > > > > > inheritance hierarchy and method reference (calling tree) browsing[/color]
                        > > that[color=darkred]
                        > > > is
                        > > > > > supported in C++. I don't know how some could write a large scale
                        > > > > > object-oriented application w/o those. If you have overcome these
                        > > > > > limitations in C#, please share your thoughts and ideas. Thanks!
                        > > > >
                        > > > >
                        > > >
                        > > >[/color]
                        > >
                        > >[/color]
                        >
                        >[/color]


                        Comment

                        • Mr.Tickle

                          #13
                          Re: why C# doesn't support &quot;friend&qu ot; relationship?

                          What about features lacking like serial ports and other kinda things that we
                          have to hook into CraptiveX components to do.


                          "Eric Gunnerson [MS]" <ericgu@online. microsoft.com> wrote in message
                          news:OsdPYpeiDH A.428@TK2MSFTNG P12.phx.gbl...[color=blue]
                          > We're considering adding some friend support in Whidbey.
                          >
                          > "Zeng" <zzy@nonospam.c om> wrote in message
                          > news:%23gvR95ci DHA.3832@tk2msf tngp13.phx.gbl. ..[color=green]
                          > >
                          > > It's so messy w/o the "friend" relationship. Does anyone know why it[/color][/color]
                          was[color=blue][color=green]
                          > > not supported in C#. It's almost about as bad as it doesn't support the
                          > > inheritance hierarchy and method reference (calling tree) browsing that[/color][/color]
                          is[color=blue][color=green]
                          > > supported in C++. I don't know how some could write a large scale
                          > > object-oriented application w/o those. If you have overcome these
                          > > limitations in C#, please share your thoughts and ideas. Thanks![/color]
                          >
                          >[/color]


                          Comment

                          • Mr.Tickle

                            #14
                            Re: why C# doesn't support &quot;friend&qu ot; relationship?

                            the C# compiler and debugger are free, you dont need any IDE if you so
                            desire.


                            "Bobby C. Jones" <bobbyj (at) acadx (dot) com> wrote in message
                            news:u0VW78eiDH A.2452@TK2MSFTN GP10.phx.gbl...[color=blue]
                            > I don't use it either. Just wanted to show that there were alternatives.
                            > And that MS isn't stopping those that have the desire to try and outdo
                            > them...
                            > --
                            > Bobby C. Jones
                            > http://code.AcadX.com
                            >
                            > "Mr.Tickle" <MrTickle@mrmen .com> wrote in message
                            > news:%235wTmUei DHA.1696@TK2MSF TNGP09.phx.gbl. ..[color=green]
                            > > no debugger, thts why that IDE sucks.
                            > >
                            > >
                            > > "Bobby C. Jones" <bobbyj (at) acadx (dot) com> wrote in message
                            > > news:uHDefGeiDH A.1048@TK2MSFTN GP11.phx.gbl...[color=darkred]
                            > > > I have no comments on comparing the two IDE's but there is an[/color][/color]
                            > alternative[color=green]
                            > > to[color=darkred]
                            > > > VC#.
                            > > >
                            > > > http://www.icsharpcode.net/
                            > > > --
                            > > > Bobby C. Jones
                            > > > http://code.AcadX.com
                            > > >
                            > > > "Zeng" <zzy@nonospam.c om> wrote in message
                            > > > news:%23HijDidi DHA.1880@tk2msf tngp13.phx.gbl. ..
                            > > > >
                            > > > > Because we only have 1 IDE (as least that I know of) available for[/color][/color][/color]
                            C#,[color=blue][color=green]
                            > > so[color=darkred]
                            > > > > practically the IDE limitation has everything to do with C#, and[/color][/color][/color]
                            woud[color=blue][color=green][color=darkred]
                            > > > > someone dare to develop their own IDE for C# to compete with MS? Or[/color]
                            > > maybe[color=darkred]
                            > > > MS
                            > > > > will write another IDE for C++ users?
                            > > > >
                            > > > >
                            > > > > "100" <100@100.com> wrote in message
                            > > > > news:ejK12XdiDH A.2984@TK2MSFTN GP11.phx.gbl...
                            > > > > > Hi Zeng,
                            > > > > >
                            > > > > > Even though, I miss *friend* once in a while I dont't thing that[/color][/color][/color]
                            is[color=blue]
                            > a[color=green][color=darkred]
                            > > > big
                            > > > > > loss.
                            > > > > > When you declare a type as inner of other type. The former is[/color][/color][/color]
                            friend[color=blue][color=green]
                            > > of[color=darkred]
                            > > > > the
                            > > > > > outer and has unlimited access to all memebers. Doesn't work the[/color][/color]
                            > other[color=green][color=darkred]
                            > > > way
                            > > > > > arround, though. I mostly used *friend* in c++ when I was[/color][/color]
                            > overloading[color=green][color=darkred]
                            > > > the
                            > > > > > operators with global functions. However, it is not the case with[/color]
                            > > .NET.[color=darkred]
                            > > > > > In addition you have *internal* access modifier.
                            > > > > > Actually I believe that *friend* methods could make the big mess[/color][/color][/color]
                            if[color=blue]
                            > it[color=green][color=darkred]
                            > > > is
                            > > > > > not used sparingly.
                            > > > > >
                            > > > > > About the second part of the question. Yes, you have all this in[/color][/color][/color]
                            the[color=blue][color=green][color=darkred]
                            > > > > *class
                            > > > > > viewer*. This is IDE feature and has nothing to do with C#, C++ or[/color][/color]
                            > any[color=green][color=darkred]
                            > > > > other
                            > > > > > language, though.
                            > > > > >
                            > > > > >
                            > > > > > HTH
                            > > > > > B\rgds
                            > > > > > 100
                            > > > > >
                            > > > > > > It's so messy w/o the "friend" relationship. Does anyone know[/color][/color][/color]
                            why[color=blue][color=green]
                            > > it[color=darkred]
                            > > > > was
                            > > > > > > not supported in C#. It's almost about as bad as it doesn't[/color][/color]
                            > support[color=green][color=darkred]
                            > > > the
                            > > > > > > inheritance hierarchy and method reference (calling tree)[/color][/color][/color]
                            browsing[color=blue][color=green][color=darkred]
                            > > > that
                            > > > > is
                            > > > > > > supported in C++. I don't know how some could write a large[/color][/color][/color]
                            scale[color=blue][color=green][color=darkred]
                            > > > > > > object-oriented application w/o those. If you have overcome[/color][/color][/color]
                            these[color=blue][color=green][color=darkred]
                            > > > > > > limitations in C#, please share your thoughts and ideas. Thanks!
                            > > > > >
                            > > > > >
                            > > > >
                            > > > >
                            > > >
                            > > >[/color]
                            > >
                            > >[/color]
                            >
                            >[/color]


                            Comment

                            • Willy Denoyette [MVP]

                              #15
                              Re: why C# doesn't support &quot;friend&qu ot; relationship?

                              These features are not related to the C# language.

                              Willy.


                              "Mr.Tickle" <MrTickle@mrmen .com> wrote in message news:uLlQNIfiDH A.1172@TK2MSFTN GP09.phx.gbl...[color=blue]
                              > What about features lacking like serial ports and other kinda things that we
                              > have to hook into CraptiveX components to do.
                              >
                              >
                              > "Eric Gunnerson [MS]" <ericgu@online. microsoft.com> wrote in message
                              > news:OsdPYpeiDH A.428@TK2MSFTNG P12.phx.gbl...[color=green]
                              > > We're considering adding some friend support in Whidbey.
                              > >
                              > > "Zeng" <zzy@nonospam.c om> wrote in message
                              > > news:%23gvR95ci DHA.3832@tk2msf tngp13.phx.gbl. ..[color=darkred]
                              > > >
                              > > > It's so messy w/o the "friend" relationship. Does anyone know why it[/color][/color]
                              > was[color=green][color=darkred]
                              > > > not supported in C#. It's almost about as bad as it doesn't support the
                              > > > inheritance hierarchy and method reference (calling tree) browsing that[/color][/color]
                              > is[color=green][color=darkred]
                              > > > supported in C++. I don't know how some could write a large scale
                              > > > object-oriented application w/o those. If you have overcome these
                              > > > limitations in C#, please share your thoughts and ideas. Thanks![/color]
                              > >
                              > >[/color]
                              >
                              >[/color]


                              Comment

                              Working...