C# code

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

    #1

    C# code

    C# is great but it does have some short comings. Here, I examine one of them
    which I definitely think is a shortcoming.
    Coming from C++, there seems to be no equivalent in C# to separate code
    cleanly for the user's benefit. Why is this important? Because a user gets
    to maintain this code, not a machine. C++ exposed us to header files which
    was a way, among other things, to cleanly separate class implementation from
    declaration. Why was this overlooked in C#? Mixing implementation and
    declaration inside a class is so ugly. Yuck!

    Sure intellisense can take you a long way, but it's a bandaid on a bruise.
    Though it is possible to separate classes out into namespaces in C# you
    still have to port the implementation with it. Yuck! A class can be
    conceived without an implementation, if only for discussion purposes. You
    are not always interested in the implementation, that is why it is so yucky.
    What if you want to take the class function declarations with you to a
    meeting to talk about your new class? This does actually happen quite
    frequently. You can't do that in C# without intimately knowing the cut and
    paste editor. Intellisense can't help you there. A class has meaning outside
    of the canvas it was carved on. A class does exist outside of the visual
    studio GUI. Do not forget, there is no intellisense at the command line.
    Probably higher level UML tools in C# builder will fit the bill, but that's
    not the point. It should be part of the language implementation because
    developers get to maintain that code. It's even more troublesome if these
    UML solutions are not included in the box.

    We've all gotten used to this mess, and if you come from Java, you've always
    had it so it seems odd to be without it. But it doesn't make it right. There
    is (make that was) a better way. I remember that time when when
    implementation and declaration were different beasts. Sure the compiler
    could care less if the implementation was on the moon and declaration on
    mars, but then again, a machine does not usually get to maintain code right?
    So it was never about the machine. It's about making life easy for
    developers. C# has failed in this regard. A more difficult life maintaining
    code means less productivity. Yes, it does make me less productive if I need
    to figure out the moving parts of a class.

    I feel better now after venting.

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits


  • Daniel O'Connell

    #2
    Re: C# code

    Interesting, one of my favorite features of C#(and java, I suppose) was the
    death of the header file.

    I recently had to go write a MC++ class and got a reminder on how annoying
    it was to have to double define methods, to have parameter lists and return
    types defined in TWO places, or my favorite in C, where if you forgot to
    define a method the compiler couldn't find it... Hell, when I'm writing C++
    code under 500 lines I'll often write my classes like I would in C#.

    I personally do not want to go back to these days, I would risk saying that
    it wasn't overlooked but turned down inherently.

    I guess I jsut don't like header files...I wonder what others think.

    "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
    message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...[color=blue]
    > C# is great but it does have some short comings. Here, I examine one of[/color]
    them[color=blue]
    > which I definitely think is a shortcoming.
    > Coming from C++, there seems to be no equivalent in C# to separate code
    > cleanly for the user's benefit. Why is this important? Because a user gets
    > to maintain this code, not a machine. C++ exposed us to header files which
    > was a way, among other things, to cleanly separate class implementation[/color]
    from[color=blue]
    > declaration. Why was this overlooked in C#? Mixing implementation and
    > declaration inside a class is so ugly. Yuck!
    >
    > Sure intellisense can take you a long way, but it's a bandaid on a bruise.
    > Though it is possible to separate classes out into namespaces in C# you
    > still have to port the implementation with it. Yuck! A class can be
    > conceived without an implementation, if only for discussion purposes. You
    > are not always interested in the implementation, that is why it is so[/color]
    yucky.[color=blue]
    > What if you want to take the class function declarations with you to a
    > meeting to talk about your new class? This does actually happen quite
    > frequently. You can't do that in C# without intimately knowing the cut and
    > paste editor. Intellisense can't help you there. A class has meaning[/color]
    outside[color=blue]
    > of the canvas it was carved on. A class does exist outside of the visual
    > studio GUI. Do not forget, there is no intellisense at the command line.
    > Probably higher level UML tools in C# builder will fit the bill, but[/color]
    that's[color=blue]
    > not the point. It should be part of the language implementation because
    > developers get to maintain that code. It's even more troublesome if these
    > UML solutions are not included in the box.
    >
    > We've all gotten used to this mess, and if you come from Java, you've[/color]
    always[color=blue]
    > had it so it seems odd to be without it. But it doesn't make it right.[/color]
    There[color=blue]
    > is (make that was) a better way. I remember that time when when
    > implementation and declaration were different beasts. Sure the compiler
    > could care less if the implementation was on the moon and declaration on
    > mars, but then again, a machine does not usually get to maintain code[/color]
    right?[color=blue]
    > So it was never about the machine. It's about making life easy for
    > developers. C# has failed in this regard. A more difficult life[/color]
    maintaining[color=blue]
    > code means less productivity. Yes, it does make me less productive if I[/color]
    need[color=blue]
    > to figure out the moving parts of a class.
    >
    > I feel better now after venting.
    >
    > --
    >
    >
    > -----------
    > Got TidBits?
    > Get it here: www.networkip.net/tidbits
    >
    >[/color]


    Comment

    • Richard A. Lowe

      #3
      Re: C# code

      Not having been a C++ programmer, I wonder if they promote a kind of
      Stockholm Syndrome in their long-term users - you have to work with them so
      much and so long that you start to feel for them and sympathize with them
      until you finally can't live without them.

      I have a difficult time imagining headers are better for separating
      definition from implementation than an abstract class or interface. Both
      are perfectly usable in the real world and both affect the total separation
      of implementation from structure.

      Richard

      --
      Veuillez m'excuser, mon Français est très pauvre. Cependant, si vous voyez
      mauvais C #, c'est mon défaut!
      "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
      news:lq0ob.5962 9$Fm2.42234@att bi_s04...[color=blue]
      > Interesting, one of my favorite features of C#(and java, I suppose) was[/color]
      the[color=blue]
      > death of the header file.
      >
      > I recently had to go write a MC++ class and got a reminder on how annoying
      > it was to have to double define methods, to have parameter lists and[/color]
      return[color=blue]
      > types defined in TWO places, or my favorite in C, where if you forgot to
      > define a method the compiler couldn't find it... Hell, when I'm writing[/color]
      C++[color=blue]
      > code under 500 lines I'll often write my classes like I would in C#.
      >
      > I personally do not want to go back to these days, I would risk saying[/color]
      that[color=blue]
      > it wasn't overlooked but turned down inherently.
      >
      > I guess I jsut don't like header files...I wonder what others think.
      >
      > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
      > message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...[color=green]
      > > C# is great but it does have some short comings. Here, I examine one of[/color]
      > them[color=green]
      > > which I definitely think is a shortcoming.
      > > Coming from C++, there seems to be no equivalent in C# to separate code
      > > cleanly for the user's benefit. Why is this important? Because a user[/color][/color]
      gets[color=blue][color=green]
      > > to maintain this code, not a machine. C++ exposed us to header files[/color][/color]
      which[color=blue][color=green]
      > > was a way, among other things, to cleanly separate class implementation[/color]
      > from[color=green]
      > > declaration. Why was this overlooked in C#? Mixing implementation and
      > > declaration inside a class is so ugly. Yuck!
      > >
      > > Sure intellisense can take you a long way, but it's a bandaid on a[/color][/color]
      bruise.[color=blue][color=green]
      > > Though it is possible to separate classes out into namespaces in C# you
      > > still have to port the implementation with it. Yuck! A class can be
      > > conceived without an implementation, if only for discussion purposes.[/color][/color]
      You[color=blue][color=green]
      > > are not always interested in the implementation, that is why it is so[/color]
      > yucky.[color=green]
      > > What if you want to take the class function declarations with you to a
      > > meeting to talk about your new class? This does actually happen quite
      > > frequently. You can't do that in C# without intimately knowing the cut[/color][/color]
      and[color=blue][color=green]
      > > paste editor. Intellisense can't help you there. A class has meaning[/color]
      > outside[color=green]
      > > of the canvas it was carved on. A class does exist outside of the visual
      > > studio GUI. Do not forget, there is no intellisense at the command line.
      > > Probably higher level UML tools in C# builder will fit the bill, but[/color]
      > that's[color=green]
      > > not the point. It should be part of the language implementation because
      > > developers get to maintain that code. It's even more troublesome if[/color][/color]
      these[color=blue][color=green]
      > > UML solutions are not included in the box.
      > >
      > > We've all gotten used to this mess, and if you come from Java, you've[/color]
      > always[color=green]
      > > had it so it seems odd to be without it. But it doesn't make it right.[/color]
      > There[color=green]
      > > is (make that was) a better way. I remember that time when when
      > > implementation and declaration were different beasts. Sure the compiler
      > > could care less if the implementation was on the moon and declaration on
      > > mars, but then again, a machine does not usually get to maintain code[/color]
      > right?[color=green]
      > > So it was never about the machine. It's about making life easy for
      > > developers. C# has failed in this regard. A more difficult life[/color]
      > maintaining[color=green]
      > > code means less productivity. Yes, it does make me less productive if I[/color]
      > need[color=green]
      > > to figure out the moving parts of a class.
      > >
      > > I feel better now after venting.
      > >
      > > --
      > >
      > >
      > > -----------
      > > Got TidBits?
      > > Get it here: www.networkip.net/tidbits
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: C# code

        Alvin Bruney <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote:[color=blue]
        > C# is great but it does have some short comings. Here, I examine one of them
        > which I definitely think is a shortcoming.
        > Coming from C++, there seems to be no equivalent in C# to separate code
        > cleanly for the user's benefit.[/color]

        The *user* (if you're talking about libraries; if you're not then the
        user doesn't see any code at all) should be reading the documentation,
        not the code.
        [color=blue]
        > Why is this important? Because a user gets
        > to maintain this code, not a machine.[/color]

        *That's* why it's important to get rid of the redundancy of
        declarations - because humans make mistakes. What's the point of
        specifying the same thing twice?
        [color=blue]
        > C++ exposed us to header files which
        > was a way, among other things, to cleanly separate class implementation from
        > declaration. Why was this overlooked in C#? Mixing implementation and
        > declaration inside a class is so ugly. Yuck![/color]

        I find the C++ way very ugly, myself.

        Note that if you want further separation, you can always use a separate
        interface in the first place.
        [color=blue]
        > Sure intellisense can take you a long way, but it's a bandaid on a bruise.
        > Though it is possible to separate classes out into namespaces in C# you
        > still have to port the implementation with it. Yuck! A class can be
        > conceived without an implementation, if only for discussion purposes.[/color]

        So use interfaces.
        [color=blue]
        > You are not always interested in the implementation, that is why it is so yucky.
        > What if you want to take the class function declarations with you to a
        > meeting to talk about your new class?[/color]

        Print out parts of the documentation. That's much more pleasant than
        taking raw code along in the first place.
        [color=blue]
        > This does actually happen quite frequently.[/color]

        I can't remember ever having to actually take such a thing to a meeting
        myself, but if I needed to take actual paper (rather than just my
        laptop) to a meeting with the interface on it, I'd print out the
        documentation for the class.
        [color=blue]
        > You can't do that in C# without intimately knowing the cut and
        > paste editor. Intellisense can't help you there. A class has meaning outside
        > of the canvas it was carved on. A class does exist outside of the visual
        > studio GUI. Do not forget, there is no intellisense at the command line.
        > Probably higher level UML tools in C# builder will fit the bill, but that's
        > not the point. It should be part of the language implementation because
        > developers get to maintain that code. It's even more troublesome if these
        > UML solutions are not included in the box.
        >
        > We've all gotten used to this mess, and if you come from Java, you've always
        > had it so it seems odd to be without it.[/color]

        Alternatively, you've gotten used to the mess in C++, which is why you
        feel lost without it. Have you considered that possibility?
        [color=blue]
        > But it doesn't make it right.[/color]

        See above :)
        [color=blue]
        > There is (make that was) a better way. I remember that time when when
        > implementation and declaration were different beasts.[/color]

        Yes, and I was forever checking out two files and making similar
        changes to both whenever I wanted to add a new method. Yuk!
        [color=blue]
        > Sure the compiler
        > could care less if the implementation was on the moon and declaration on
        > mars, but then again, a machine does not usually get to maintain code right?
        > So it was never about the machine. It's about making life easy for
        > developers.[/color]

        Specifying the same thing twice is easier than only specifying it once?
        [color=blue]
        > C# has failed in this regard. A more difficult life maintaining
        > code means less productivity. Yes, it does make me less productive if I need
        > to figure out the moving parts of a class.[/color]

        I think you seriously need to look at NDoc... I'd much rather look at
        documentation for a class than raw C++ headers.

        --
        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

        • Alan Pretre

          #5
          Re: C# code

          "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
          message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...[color=blue]
          > C++ exposed us to header files which
          > was a way, among other things, to cleanly separate class implementation[/color]
          from[color=blue]
          > declaration.[/color]

          This isn't quite true. There is much in a C++ class declaration that
          reveals its implementation. For example, all of its private members and
          methods, and its ancestors. .NET Interfaces are much better than this
          because they only show the public members.

          -- Alan


          Comment

          • Alvin Bruney

            #6
            Re: C# code

            > I recently had to go write a MC++ class and got a reminder on how annoying[color=blue]
            > it was to have to double define methods,[/color]

            No runtime allows double definition of methods, I'm sure I must have missed
            your point. Would you care to clarify?. Overloaded methods are entirely
            different.

            --


            -----------
            Got TidBits?
            Get it here: www.networkip.net/tidbits
            "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
            news:lq0ob.5962 9$Fm2.42234@att bi_s04...[color=blue]
            > Interesting, one of my favorite features of C#(and java, I suppose) was[/color]
            the[color=blue]
            > death of the header file.
            >
            > I recently had to go write a MC++ class and got a reminder on how annoying
            > it was to have to double define methods, to have parameter lists and[/color]
            return[color=blue]
            > types defined in TWO places, or my favorite in C, where if you forgot to
            > define a method the compiler couldn't find it... Hell, when I'm writing[/color]
            C++[color=blue]
            > code under 500 lines I'll often write my classes like I would in C#.
            >
            > I personally do not want to go back to these days, I would risk saying[/color]
            that[color=blue]
            > it wasn't overlooked but turned down inherently.
            >
            > I guess I jsut don't like header files...I wonder what others think.
            >
            > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
            > message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...[color=green]
            > > C# is great but it does have some short comings. Here, I examine one of[/color]
            > them[color=green]
            > > which I definitely think is a shortcoming.
            > > Coming from C++, there seems to be no equivalent in C# to separate code
            > > cleanly for the user's benefit. Why is this important? Because a user[/color][/color]
            gets[color=blue][color=green]
            > > to maintain this code, not a machine. C++ exposed us to header files[/color][/color]
            which[color=blue][color=green]
            > > was a way, among other things, to cleanly separate class implementation[/color]
            > from[color=green]
            > > declaration. Why was this overlooked in C#? Mixing implementation and
            > > declaration inside a class is so ugly. Yuck!
            > >
            > > Sure intellisense can take you a long way, but it's a bandaid on a[/color][/color]
            bruise.[color=blue][color=green]
            > > Though it is possible to separate classes out into namespaces in C# you
            > > still have to port the implementation with it. Yuck! A class can be
            > > conceived without an implementation, if only for discussion purposes.[/color][/color]
            You[color=blue][color=green]
            > > are not always interested in the implementation, that is why it is so[/color]
            > yucky.[color=green]
            > > What if you want to take the class function declarations with you to a
            > > meeting to talk about your new class? This does actually happen quite
            > > frequently. You can't do that in C# without intimately knowing the cut[/color][/color]
            and[color=blue][color=green]
            > > paste editor. Intellisense can't help you there. A class has meaning[/color]
            > outside[color=green]
            > > of the canvas it was carved on. A class does exist outside of the visual
            > > studio GUI. Do not forget, there is no intellisense at the command line.
            > > Probably higher level UML tools in C# builder will fit the bill, but[/color]
            > that's[color=green]
            > > not the point. It should be part of the language implementation because
            > > developers get to maintain that code. It's even more troublesome if[/color][/color]
            these[color=blue][color=green]
            > > UML solutions are not included in the box.
            > >
            > > We've all gotten used to this mess, and if you come from Java, you've[/color]
            > always[color=green]
            > > had it so it seems odd to be without it. But it doesn't make it right.[/color]
            > There[color=green]
            > > is (make that was) a better way. I remember that time when when
            > > implementation and declaration were different beasts. Sure the compiler
            > > could care less if the implementation was on the moon and declaration on
            > > mars, but then again, a machine does not usually get to maintain code[/color]
            > right?[color=green]
            > > So it was never about the machine. It's about making life easy for
            > > developers. C# has failed in this regard. A more difficult life[/color]
            > maintaining[color=green]
            > > code means less productivity. Yes, it does make me less productive if I[/color]
            > need[color=green]
            > > to figure out the moving parts of a class.
            > >
            > > I feel better now after venting.
            > >
            > > --
            > >
            > >
            > > -----------
            > > Got TidBits?
            > > Get it here: www.networkip.net/tidbits
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Alvin Bruney

              #7
              Re: C# code

              > I have a difficult time imagining headers are better for separating
              but that's the whole point you are missing. Why do I need to implement an
              interface just to get what I want? I do not want an interface because it
              forces me into an avenue I'm not prepared to handle (certainly, that's valid
              for some reasons). And why should this separation come at a price of using
              interfaces and it's baggage. With C++, that separation is clean and free. It
              doesn't force you to implement some other feature just to get what you are
              asking. Unlike C#

              Guess you all are java guys uh? I'd better head for the exit

              --


              -----------
              Got TidBits?
              Get it here: www.networkip.net/tidbits
              "Richard A. Lowe" <chadich@yumspa myumYahoo.com> wrote in message
              news:#p#MAzqnDH A.1728@TK2MSFTN GP09.phx.gbl...[color=blue]
              > Not having been a C++ programmer, I wonder if they promote a kind of
              > Stockholm Syndrome in their long-term users - you have to work with them[/color]
              so[color=blue]
              > much and so long that you start to feel for them and sympathize with them
              > until you finally can't live without them.
              >
              > I have a difficult time imagining headers are better for separating
              > definition from implementation than an abstract class or interface. Both
              > are perfectly usable in the real world and both affect the total[/color]
              separation[color=blue]
              > of implementation from structure.
              >
              > Richard
              >
              > --
              > Veuillez m'excuser, mon Français est très pauvre. Cependant, si vous[/color]
              voyez[color=blue]
              > mauvais C #, c'est mon défaut!
              > "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
              > news:lq0ob.5962 9$Fm2.42234@att bi_s04...[color=green]
              > > Interesting, one of my favorite features of C#(and java, I suppose) was[/color]
              > the[color=green]
              > > death of the header file.
              > >
              > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
              annoying[color=blue][color=green]
              > > it was to have to double define methods, to have parameter lists and[/color]
              > return[color=green]
              > > types defined in TWO places, or my favorite in C, where if you forgot to
              > > define a method the compiler couldn't find it... Hell, when I'm writing[/color]
              > C++[color=green]
              > > code under 500 lines I'll often write my classes like I would in C#.
              > >
              > > I personally do not want to go back to these days, I would risk saying[/color]
              > that[color=green]
              > > it wasn't overlooked but turned down inherently.
              > >
              > > I guess I jsut don't like header files...I wonder what others think.
              > >
              > > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote[/color][/color]
              in[color=blue][color=green]
              > > message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...[color=darkred]
              > > > C# is great but it does have some short comings. Here, I examine one[/color][/color][/color]
              of[color=blue][color=green]
              > > them[color=darkred]
              > > > which I definitely think is a shortcoming.
              > > > Coming from C++, there seems to be no equivalent in C# to separate[/color][/color][/color]
              code[color=blue][color=green][color=darkred]
              > > > cleanly for the user's benefit. Why is this important? Because a user[/color][/color]
              > gets[color=green][color=darkred]
              > > > to maintain this code, not a machine. C++ exposed us to header files[/color][/color]
              > which[color=green][color=darkred]
              > > > was a way, among other things, to cleanly separate class[/color][/color][/color]
              implementation[color=blue][color=green]
              > > from[color=darkred]
              > > > declaration. Why was this overlooked in C#? Mixing implementation and
              > > > declaration inside a class is so ugly. Yuck!
              > > >
              > > > Sure intellisense can take you a long way, but it's a bandaid on a[/color][/color]
              > bruise.[color=green][color=darkred]
              > > > Though it is possible to separate classes out into namespaces in C#[/color][/color][/color]
              you[color=blue][color=green][color=darkred]
              > > > still have to port the implementation with it. Yuck! A class can be
              > > > conceived without an implementation, if only for discussion purposes.[/color][/color]
              > You[color=green][color=darkred]
              > > > are not always interested in the implementation, that is why it is so[/color]
              > > yucky.[color=darkred]
              > > > What if you want to take the class function declarations with you to a
              > > > meeting to talk about your new class? This does actually happen quite
              > > > frequently. You can't do that in C# without intimately knowing the cut[/color][/color]
              > and[color=green][color=darkred]
              > > > paste editor. Intellisense can't help you there. A class has meaning[/color]
              > > outside[color=darkred]
              > > > of the canvas it was carved on. A class does exist outside of the[/color][/color][/color]
              visual[color=blue][color=green][color=darkred]
              > > > studio GUI. Do not forget, there is no intellisense at the command[/color][/color][/color]
              line.[color=blue][color=green][color=darkred]
              > > > Probably higher level UML tools in C# builder will fit the bill, but[/color]
              > > that's[color=darkred]
              > > > not the point. It should be part of the language implementation[/color][/color][/color]
              because[color=blue][color=green][color=darkred]
              > > > developers get to maintain that code. It's even more troublesome if[/color][/color]
              > these[color=green][color=darkred]
              > > > UML solutions are not included in the box.
              > > >
              > > > We've all gotten used to this mess, and if you come from Java, you've[/color]
              > > always[color=darkred]
              > > > had it so it seems odd to be without it. But it doesn't make it right.[/color]
              > > There[color=darkred]
              > > > is (make that was) a better way. I remember that time when when
              > > > implementation and declaration were different beasts. Sure the[/color][/color][/color]
              compiler[color=blue][color=green][color=darkred]
              > > > could care less if the implementation was on the moon and declaration[/color][/color][/color]
              on[color=blue][color=green][color=darkred]
              > > > mars, but then again, a machine does not usually get to maintain code[/color]
              > > right?[color=darkred]
              > > > So it was never about the machine. It's about making life easy for
              > > > developers. C# has failed in this regard. A more difficult life[/color]
              > > maintaining[color=darkred]
              > > > code means less productivity. Yes, it does make me less productive if[/color][/color][/color]
              I[color=blue][color=green]
              > > need[color=darkred]
              > > > to figure out the moving parts of a class.
              > > >
              > > > I feel better now after venting.
              > > >
              > > > --
              > > >
              > > >
              > > > -----------
              > > > Got TidBits?
              > > > Get it here: www.networkip.net/tidbits
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Alvin Bruney

                #8
                Re: C# code

                >The *user* (if you're talking about libraries; if you're not then the[color=blue]
                > user doesn't see any code at all) should be reading the documentation,
                > not the code.
                >[/color]
                c'mon Jon,
                you know this aint real world. How many times has docs kept up with the
                source code. Its wrong but it's true, programmers prefer to look at source
                rather than docs. Occasionally, you may find someone heading to the docs but
                by far, most programmers consult the source code first.
                [color=blue]
                > Note that if you want further separation, you can always use a separate
                > interface in the first place.[/color]
                No you are selling me something I don't want just to get what I want. I want
                to separate a class implementation from its declaration. I don't want to be
                forced to carry an interface baggage. Is there a way to do that in C#? No.
                [color=blue]
                > Yes, and I was forever checking out two files and making similar
                > changes to both whenever I wanted to add a new method. Yuk![/color]
                how is that different from interfaces?
                [color=blue]
                > Alternatively, you've gotten used to the mess in C++, which is why you
                > feel lost without it. Have you considered that possibility?[/color]
                Some parts of that are true. Lost is a strong word though.
                --


                -----------
                Got TidBits?
                Get it here: www.networkip.net/tidbits
                "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
                news:MPG.1a0ad4 28f455039898999 7@msnews.micros oft.com...[color=blue]
                > Alvin Bruney <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote:[color=green]
                > > C# is great but it does have some short comings. Here, I examine one of[/color][/color]
                them[color=blue][color=green]
                > > which I definitely think is a shortcoming.
                > > Coming from C++, there seems to be no equivalent in C# to separate code
                > > cleanly for the user's benefit.[/color]
                >
                > The *user* (if you're talking about libraries; if you're not then the
                > user doesn't see any code at all) should be reading the documentation,
                > not the code.
                >[color=green]
                > > Why is this important? Because a user gets
                > > to maintain this code, not a machine.[/color]
                >
                > *That's* why it's important to get rid of the redundancy of
                > declarations - because humans make mistakes. What's the point of
                > specifying the same thing twice?
                >[color=green]
                > > C++ exposed us to header files which
                > > was a way, among other things, to cleanly separate class implementation[/color][/color]
                from[color=blue][color=green]
                > > declaration. Why was this overlooked in C#? Mixing implementation and
                > > declaration inside a class is so ugly. Yuck![/color]
                >
                > I find the C++ way very ugly, myself.
                >
                > Note that if you want further separation, you can always use a separate
                > interface in the first place.
                >[color=green]
                > > Sure intellisense can take you a long way, but it's a bandaid on a[/color][/color]
                bruise.[color=blue][color=green]
                > > Though it is possible to separate classes out into namespaces in C# you
                > > still have to port the implementation with it. Yuck! A class can be
                > > conceived without an implementation, if only for discussion purposes.[/color]
                >
                > So use interfaces.
                >[color=green]
                > > You are not always interested in the implementation, that is why it is[/color][/color]
                so yucky.[color=blue][color=green]
                > > What if you want to take the class function declarations with you to a
                > > meeting to talk about your new class?[/color]
                >
                > Print out parts of the documentation. That's much more pleasant than
                > taking raw code along in the first place.
                >[color=green]
                > > This does actually happen quite frequently.[/color]
                >
                > I can't remember ever having to actually take such a thing to a meeting
                > myself, but if I needed to take actual paper (rather than just my
                > laptop) to a meeting with the interface on it, I'd print out the
                > documentation for the class.
                >[color=green]
                > > You can't do that in C# without intimately knowing the cut and
                > > paste editor. Intellisense can't help you there. A class has meaning[/color][/color]
                outside[color=blue][color=green]
                > > of the canvas it was carved on. A class does exist outside of the visual
                > > studio GUI. Do not forget, there is no intellisense at the command line.
                > > Probably higher level UML tools in C# builder will fit the bill, but[/color][/color]
                that's[color=blue][color=green]
                > > not the point. It should be part of the language implementation because
                > > developers get to maintain that code. It's even more troublesome if[/color][/color]
                these[color=blue][color=green]
                > > UML solutions are not included in the box.
                > >
                > > We've all gotten used to this mess, and if you come from Java, you've[/color][/color]
                always[color=blue][color=green]
                > > had it so it seems odd to be without it.[/color]
                >
                > Alternatively, you've gotten used to the mess in C++, which is why you
                > feel lost without it. Have you considered that possibility?
                >[color=green]
                > > But it doesn't make it right.[/color]
                >
                > See above :)
                >[color=green]
                > > There is (make that was) a better way. I remember that time when when
                > > implementation and declaration were different beasts.[/color]
                >
                > Yes, and I was forever checking out two files and making similar
                > changes to both whenever I wanted to add a new method. Yuk!
                >[color=green]
                > > Sure the compiler
                > > could care less if the implementation was on the moon and declaration on
                > > mars, but then again, a machine does not usually get to maintain code[/color][/color]
                right?[color=blue][color=green]
                > > So it was never about the machine. It's about making life easy for
                > > developers.[/color]
                >
                > Specifying the same thing twice is easier than only specifying it once?
                >[color=green]
                > > C# has failed in this regard. A more difficult life maintaining
                > > code means less productivity. Yes, it does make me less productive if I[/color][/color]
                need[color=blue][color=green]
                > > to figure out the moving parts of a class.[/color]
                >
                > I think you seriously need to look at NDoc... I'd much rather look at
                > documentation for a class than raw C++ headers.
                >
                > --
                > Jon Skeet - <skeet@pobox.co m>
                > http://www.pobox.com/~skeet
                > If replying to the group, please do not mail me too[/color]


                Comment

                • Jon Skeet [C# MVP]

                  #9
                  Re: C# code

                  Alvin Bruney <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote:[color=blue][color=green]
                  > >The *user* (if you're talking about libraries; if you're not then the
                  > > user doesn't see any code at all) should be reading the documentation,
                  > > not the code.
                  > >[/color]
                  > c'mon Jon,
                  > you know this aint real world. How many times has docs kept up with the
                  > source code. Its wrong but it's true, programmers prefer to look at source
                  > rather than docs.[/color]

                  So when they want to see the implementation, they look at the real
                  source. They'd have to do that in C++ as well, so you haven't shown any
                  benefit there.
                  [color=blue]
                  > Occasionally, you may find someone heading to the docs but
                  > by far, most programmers consult the source code first.[/color]

                  I don't believe that's the case with .NET and languages like Java where
                  there's a common documentation system which they'll be used to for the
                  base libraries to start with. When JavaDoc is provided with a Java
                  library, that's what people look at first, IME - followed by whatever
                  other documentation is provided, followed by the code itself.
                  [color=blue][color=green]
                  > > Note that if you want further separation, you can always use a separate
                  > > interface in the first place.[/color][/color]
                  [color=blue]
                  > No you are selling me something I don't want just to get what I want. I want
                  > to separate a class implementation from its declaration.[/color]

                  Why though? None of your arguments so far hold water, as far as I've
                  seen.
                  [color=blue]
                  > I don't want to be
                  > forced to carry an interface baggage. Is there a way to do that in C#? No.[/color]

                  Thank goodness, IMO.
                  [color=blue][color=green]
                  > > Yes, and I was forever checking out two files and making similar
                  > > changes to both whenever I wanted to add a new method. Yuk![/color]
                  >
                  > how is that different from interfaces?[/color]

                  I (usually) don't *have* to use interfaces when I don't want to, and I
                  don't have to add declarations for private members.

                  --
                  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

                  • Alvin Bruney

                    #10
                    Re: C# code

                    > Why though? None of your arguments so far hold water, as far as I've[color=blue]
                    > seen.[/color]

                    gowd,
                    i'm heading for the exits. java programmers out to get me...

                    --


                    -----------
                    Got TidBits?
                    Get it here: www.networkip.net/tidbits
                    "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
                    news:MPG.1a0b4e c8711ee8b69899a 9@msnews.micros oft.com...[color=blue]
                    > Alvin Bruney <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote:[color=green][color=darkred]
                    > > >The *user* (if you're talking about libraries; if you're not then the
                    > > > user doesn't see any code at all) should be reading the documentation,
                    > > > not the code.
                    > > >[/color]
                    > > c'mon Jon,
                    > > you know this aint real world. How many times has docs kept up with the
                    > > source code. Its wrong but it's true, programmers prefer to look at[/color][/color]
                    source[color=blue][color=green]
                    > > rather than docs.[/color]
                    >
                    > So when they want to see the implementation, they look at the real
                    > source. They'd have to do that in C++ as well, so you haven't shown any
                    > benefit there.
                    >[color=green]
                    > > Occasionally, you may find someone heading to the docs but
                    > > by far, most programmers consult the source code first.[/color]
                    >
                    > I don't believe that's the case with .NET and languages like Java where
                    > there's a common documentation system which they'll be used to for the
                    > base libraries to start with. When JavaDoc is provided with a Java
                    > library, that's what people look at first, IME - followed by whatever
                    > other documentation is provided, followed by the code itself.
                    >[color=green][color=darkred]
                    > > > Note that if you want further separation, you can always use a[/color][/color][/color]
                    separate[color=blue][color=green][color=darkred]
                    > > > interface in the first place.[/color][/color]
                    >[color=green]
                    > > No you are selling me something I don't want just to get what I want. I[/color][/color]
                    want[color=blue][color=green]
                    > > to separate a class implementation from its declaration.[/color]
                    >
                    > Why though? None of your arguments so far hold water, as far as I've
                    > seen.
                    >[color=green]
                    > > I don't want to be
                    > > forced to carry an interface baggage. Is there a way to do that in C#?[/color][/color]
                    No.[color=blue]
                    >
                    > Thank goodness, IMO.
                    >[color=green][color=darkred]
                    > > > Yes, and I was forever checking out two files and making similar
                    > > > changes to both whenever I wanted to add a new method. Yuk![/color]
                    > >
                    > > how is that different from interfaces?[/color]
                    >
                    > I (usually) don't *have* to use interfaces when I don't want to, and I
                    > don't have to add declarations for private members.
                    >
                    > --
                    > Jon Skeet - <skeet@pobox.co m>
                    > http://www.pobox.com/~skeet
                    > If replying to the group, please do not mail me too[/color]


                    Comment

                    • Fred Mellender

                      #11
                      Re: C# code, .h files, collapse to definition

                      If you right click in the source window for a class (in the MDE), select
                      outline/collapse-to-definitions, you get what looks like a ".h" file. All
                      the code is hidden; the definitions remain. Isn't this the same convenience
                      as having a .h file to look at? If you print the file while the code is
                      collapsed, you get a print-out you can use as if it were a .h file.


                      "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
                      message news:%23Jc9T2vn DHA.3612@TK2MSF TNGP11.phx.gbl. ..[color=blue][color=green]
                      > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
                      annoying[color=blue][color=green]
                      > > it was to have to double define methods,[/color]
                      >
                      > No runtime allows double definition of methods, I'm sure I must have[/color]
                      missed[color=blue]
                      > your point. Would you care to clarify?. Overloaded methods are entirely
                      > different.
                      >
                      > --
                      >
                      >
                      > -----------
                      > Got TidBits?
                      > Get it here: www.networkip.net/tidbits
                      > "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
                      > news:lq0ob.5962 9$Fm2.42234@att bi_s04...[color=green]
                      > > Interesting, one of my favorite features of C#(and java, I suppose) was[/color]
                      > the[color=green]
                      > > death of the header file.
                      > >
                      > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
                      annoying[color=blue][color=green]
                      > > it was to have to double define methods, to have parameter lists and[/color]
                      > return[color=green]
                      > > types defined in TWO places, or my favorite in C, where if you forgot to
                      > > define a method the compiler couldn't find it... Hell, when I'm writing[/color]
                      > C++[color=green]
                      > > code under 500 lines I'll often write my classes like I would in C#.
                      > >
                      > > I personally do not want to go back to these days, I would risk saying[/color]
                      > that[color=green]
                      > > it wasn't overlooked but turned down inherently.
                      > >
                      > > I guess I jsut don't like header files...I wonder what others think.
                      > >
                      > > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote[/color][/color]
                      in[color=blue][color=green]
                      > > message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...[color=darkred]
                      > > > C# is great but it does have some short comings. Here, I examine one[/color][/color][/color]
                      of[color=blue][color=green]
                      > > them[color=darkred]
                      > > > which I definitely think is a shortcoming.
                      > > > Coming from C++, there seems to be no equivalent in C# to separate[/color][/color][/color]
                      code[color=blue][color=green][color=darkred]
                      > > > cleanly for the user's benefit. Why is this important? Because a user[/color][/color]
                      > gets[color=green][color=darkred]
                      > > > to maintain this code, not a machine. C++ exposed us to header files[/color][/color]
                      > which[color=green][color=darkred]
                      > > > was a way, among other things, to cleanly separate class[/color][/color][/color]
                      implementation[color=blue][color=green]
                      > > from[color=darkred]
                      > > > declaration. Why was this overlooked in C#? Mixing implementation and
                      > > > declaration inside a class is so ugly. Yuck!
                      > > >
                      > > > Sure intellisense can take you a long way, but it's a bandaid on a[/color][/color]
                      > bruise.[color=green][color=darkred]
                      > > > Though it is possible to separate classes out into namespaces in C#[/color][/color][/color]
                      you[color=blue][color=green][color=darkred]
                      > > > still have to port the implementation with it. Yuck! A class can be
                      > > > conceived without an implementation, if only for discussion purposes.[/color][/color]
                      > You[color=green][color=darkred]
                      > > > are not always interested in the implementation, that is why it is so[/color]
                      > > yucky.[color=darkred]
                      > > > What if you want to take the class function declarations with you to a
                      > > > meeting to talk about your new class? This does actually happen quite
                      > > > frequently. You can't do that in C# without intimately knowing the cut[/color][/color]
                      > and[color=green][color=darkred]
                      > > > paste editor. Intellisense can't help you there. A class has meaning[/color]
                      > > outside[color=darkred]
                      > > > of the canvas it was carved on. A class does exist outside of the[/color][/color][/color]
                      visual[color=blue][color=green][color=darkred]
                      > > > studio GUI. Do not forget, there is no intellisense at the command[/color][/color][/color]
                      line.[color=blue][color=green][color=darkred]
                      > > > Probably higher level UML tools in C# builder will fit the bill, but[/color]
                      > > that's[color=darkred]
                      > > > not the point. It should be part of the language implementation[/color][/color][/color]
                      because[color=blue][color=green][color=darkred]
                      > > > developers get to maintain that code. It's even more troublesome if[/color][/color]
                      > these[color=green][color=darkred]
                      > > > UML solutions are not included in the box.
                      > > >
                      > > > We've all gotten used to this mess, and if you come from Java, you've[/color]
                      > > always[color=darkred]
                      > > > had it so it seems odd to be without it. But it doesn't make it right.[/color]
                      > > There[color=darkred]
                      > > > is (make that was) a better way. I remember that time when when
                      > > > implementation and declaration were different beasts. Sure the[/color][/color][/color]
                      compiler[color=blue][color=green][color=darkred]
                      > > > could care less if the implementation was on the moon and declaration[/color][/color][/color]
                      on[color=blue][color=green][color=darkred]
                      > > > mars, but then again, a machine does not usually get to maintain code[/color]
                      > > right?[color=darkred]
                      > > > So it was never about the machine. It's about making life easy for
                      > > > developers. C# has failed in this regard. A more difficult life[/color]
                      > > maintaining[color=darkred]
                      > > > code means less productivity. Yes, it does make me less productive if[/color][/color][/color]
                      I[color=blue][color=green]
                      > > need[color=darkred]
                      > > > to figure out the moving parts of a class.
                      > > >
                      > > > I feel better now after venting.
                      > > >
                      > > > --
                      > > >
                      > > >
                      > > > -----------
                      > > > Got TidBits?
                      > > > Get it here: www.networkip.net/tidbits
                      > > >
                      > > >[/color]
                      > >
                      > >[/color]
                      >
                      >[/color]


                      Comment

                      • Alvin Bruney

                        #12
                        Re: C# code, .h files, collapse to definition

                        hmmm,
                        i didnt know it printed collapse.

                        If this really works (no printer installed in new office) then I guess my
                        arguments don't hold water. Blame it on ignorance. This round goes to .NET!
                        regards

                        --


                        -----------
                        Got TidBits?
                        Get it here: www.networkip.net/tidbits
                        "Fred Mellender" <nospamPlease_f redm@frontierne t.net> wrote in message
                        news:MCbob.7089 $7q3.1628@news0 2.roc.ny...[color=blue]
                        > If you right click in the source window for a class (in the MDE), select
                        > outline/collapse-to-definitions, you get what looks like a ".h" file. All
                        > the code is hidden; the definitions remain. Isn't this the same[/color]
                        convenience[color=blue]
                        > as having a .h file to look at? If you print the file while the code is
                        > collapsed, you get a print-out you can use as if it were a .h file.
                        >
                        >
                        > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
                        > message news:%23Jc9T2vn DHA.3612@TK2MSF TNGP11.phx.gbl. ..[color=green][color=darkred]
                        > > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
                        > annoying[color=green][color=darkred]
                        > > > it was to have to double define methods,[/color]
                        > >
                        > > No runtime allows double definition of methods, I'm sure I must have[/color]
                        > missed[color=green]
                        > > your point. Would you care to clarify?. Overloaded methods are entirely
                        > > different.
                        > >
                        > > --
                        > >
                        > >
                        > > -----------
                        > > Got TidBits?
                        > > Get it here: www.networkip.net/tidbits
                        > > "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
                        > > news:lq0ob.5962 9$Fm2.42234@att bi_s04...[color=darkred]
                        > > > Interesting, one of my favorite features of C#(and java, I suppose)[/color][/color][/color]
                        was[color=blue][color=green]
                        > > the[color=darkred]
                        > > > death of the header file.
                        > > >
                        > > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
                        > annoying[color=green][color=darkred]
                        > > > it was to have to double define methods, to have parameter lists and[/color]
                        > > return[color=darkred]
                        > > > types defined in TWO places, or my favorite in C, where if you forgot[/color][/color][/color]
                        to[color=blue][color=green][color=darkred]
                        > > > define a method the compiler couldn't find it... Hell, when I'm[/color][/color][/color]
                        writing[color=blue][color=green]
                        > > C++[color=darkred]
                        > > > code under 500 lines I'll often write my classes like I would in C#.
                        > > >
                        > > > I personally do not want to go back to these days, I would risk saying[/color]
                        > > that[color=darkred]
                        > > > it wasn't overlooked but turned down inherently.
                        > > >
                        > > > I guess I jsut don't like header files...I wonder what others think.
                        > > >
                        > > > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote[/color][/color]
                        > in[color=green][color=darkred]
                        > > > message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...
                        > > > > C# is great but it does have some short comings. Here, I examine one[/color][/color]
                        > of[color=green][color=darkred]
                        > > > them
                        > > > > which I definitely think is a shortcoming.
                        > > > > Coming from C++, there seems to be no equivalent in C# to separate[/color][/color]
                        > code[color=green][color=darkred]
                        > > > > cleanly for the user's benefit. Why is this important? Because a[/color][/color][/color]
                        user[color=blue][color=green]
                        > > gets[color=darkred]
                        > > > > to maintain this code, not a machine. C++ exposed us to header files[/color]
                        > > which[color=darkred]
                        > > > > was a way, among other things, to cleanly separate class[/color][/color]
                        > implementation[color=green][color=darkred]
                        > > > from
                        > > > > declaration. Why was this overlooked in C#? Mixing implementation[/color][/color][/color]
                        and[color=blue][color=green][color=darkred]
                        > > > > declaration inside a class is so ugly. Yuck!
                        > > > >
                        > > > > Sure intellisense can take you a long way, but it's a bandaid on a[/color]
                        > > bruise.[color=darkred]
                        > > > > Though it is possible to separate classes out into namespaces in C#[/color][/color]
                        > you[color=green][color=darkred]
                        > > > > still have to port the implementation with it. Yuck! A class can be
                        > > > > conceived without an implementation, if only for discussion[/color][/color][/color]
                        purposes.[color=blue][color=green]
                        > > You[color=darkred]
                        > > > > are not always interested in the implementation, that is why it is[/color][/color][/color]
                        so[color=blue][color=green][color=darkred]
                        > > > yucky.
                        > > > > What if you want to take the class function declarations with you to[/color][/color][/color]
                        a[color=blue][color=green][color=darkred]
                        > > > > meeting to talk about your new class? This does actually happen[/color][/color][/color]
                        quite[color=blue][color=green][color=darkred]
                        > > > > frequently. You can't do that in C# without intimately knowing the[/color][/color][/color]
                        cut[color=blue][color=green]
                        > > and[color=darkred]
                        > > > > paste editor. Intellisense can't help you there. A class has meaning
                        > > > outside
                        > > > > of the canvas it was carved on. A class does exist outside of the[/color][/color]
                        > visual[color=green][color=darkred]
                        > > > > studio GUI. Do not forget, there is no intellisense at the command[/color][/color]
                        > line.[color=green][color=darkred]
                        > > > > Probably higher level UML tools in C# builder will fit the bill, but
                        > > > that's
                        > > > > not the point. It should be part of the language implementation[/color][/color]
                        > because[color=green][color=darkred]
                        > > > > developers get to maintain that code. It's even more troublesome if[/color]
                        > > these[color=darkred]
                        > > > > UML solutions are not included in the box.
                        > > > >
                        > > > > We've all gotten used to this mess, and if you come from Java,[/color][/color][/color]
                        you've[color=blue][color=green][color=darkred]
                        > > > always
                        > > > > had it so it seems odd to be without it. But it doesn't make it[/color][/color][/color]
                        right.[color=blue][color=green][color=darkred]
                        > > > There
                        > > > > is (make that was) a better way. I remember that time when when
                        > > > > implementation and declaration were different beasts. Sure the[/color][/color]
                        > compiler[color=green][color=darkred]
                        > > > > could care less if the implementation was on the moon and[/color][/color][/color]
                        declaration[color=blue]
                        > on[color=green][color=darkred]
                        > > > > mars, but then again, a machine does not usually get to maintain[/color][/color][/color]
                        code[color=blue][color=green][color=darkred]
                        > > > right?
                        > > > > So it was never about the machine. It's about making life easy for
                        > > > > developers. C# has failed in this regard. A more difficult life
                        > > > maintaining
                        > > > > code means less productivity. Yes, it does make me less productive[/color][/color][/color]
                        if[color=blue]
                        > I[color=green][color=darkred]
                        > > > need
                        > > > > to figure out the moving parts of a class.
                        > > > >
                        > > > > I feel better now after venting.
                        > > > >
                        > > > > --
                        > > > >
                        > > > >
                        > > > > -----------
                        > > > > Got TidBits?
                        > > > > Get it here: www.networkip.net/tidbits
                        > > > >
                        > > > >
                        > > >
                        > > >[/color]
                        > >
                        > >[/color]
                        >
                        >[/color]


                        Comment

                        • Ray Hsieh (Ray Djajadinata)

                          #13
                          Re: C# code

                          -----BEGIN PGP SIGNED MESSAGE-----
                          Hash: SHA1

                          I come from a C/C++ background as well, before going to Java and then
                          C#. I think Java's and C#'s approaches are just fine.

                          Don't get me wrong, I know your pain, I've been through that the first
                          time I moved to Java. I was so used to checking the header file when I
                          wanted a quick peek at the *declarations*, especially because the Class
                          View of VS back then was sometimes not very helpful, thanks to the macro
                          expansion, message maps, and all those yucky stuff that comes with MFC
                          and ATL.

                          So my first reflex when I wanted to check the declarations quickly, in
                          Java, was to open the Java source files, which seemed excessively
                          cluttered, exactly for the reason you mentioned. But then I realized
                          something: I had to open C++ header files because the tool didn't give
                          me good enough support back then. In Java, however, any decent IDE will
                          give you all the info you need the moment you add a JAR file into your
                          project.

                          So this is about declarations, and we've addressed that :)

                          What about implementation? In all 3 languages, if you want to look at
                          the implementation, you *have* to endure all those clutter *anyway*. And
                          note that in all 3 languages, the vendor can always choose to hide their
                          implementation, be it in a .lib, .dll, or .jar. So no, C++ approach is
                          not better. It is more primitive, even.

                          And I think maintaining ONE file for each class is better than
                          maintaining TWO files for each class, thank you. Especially (now I'm
                          talking about Java here) with the extensive refactoring support
                          available in many popular Java IDEs.

                          And don't even get me started about the mess of declaring static
                          variable and the linker errors in C++! Argh! :)

                          Alvin Bruney wrote:

                          | gowd,
                          | i'm heading for the exits. java programmers out to get me...

                          - --
                          Ray Hsieh (Ray Djajadinata) [SCJP, SCWCD]
                          ray underscore usenet at yahoo dot com
                          -----BEGIN PGP SIGNATURE-----
                          Version: GnuPG v1.2.3 (MingW32)
                          Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

                          iD8DBQE/oVJlwEwccQ4rWPg RAq7jAJ9W4MlrzS j+QvLPfkMxW7jwf LqwSACfTynY
                          HMiXdvBwTJ9Q0/kEFFGQ+nQ=
                          =FMQk
                          -----END PGP SIGNATURE-----

                          Comment

                          • Daniel O'Connell

                            #14
                            Re: C# code

                            Actually, I cut my teeth on x86 Assembly and C\C++, then VB and C#, never
                            really learned Java. I just think C\C++ has an inherently troubled model for
                            alot of things, including type definitions.

                            "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
                            message news:u%23W%23E6 vnDHA.3316@TK2M SFTNGP11.phx.gb l...[color=blue][color=green]
                            > > I have a difficult time imagining headers are better for separating[/color]
                            > but that's the whole point you are missing. Why do I need to implement an
                            > interface just to get what I want? I do not want an interface because it
                            > forces me into an avenue I'm not prepared to handle (certainly, that's[/color]
                            valid[color=blue]
                            > for some reasons). And why should this separation come at a price of using
                            > interfaces and it's baggage. With C++, that separation is clean and free.[/color]
                            It[color=blue]
                            > doesn't force you to implement some other feature just to get what you are
                            > asking. Unlike C#
                            >
                            > Guess you all are java guys uh? I'd better head for the exit
                            >
                            > --
                            >
                            >
                            > -----------
                            > Got TidBits?
                            > Get it here: www.networkip.net/tidbits
                            > "Richard A. Lowe" <chadich@yumspa myumYahoo.com> wrote in message
                            > news:#p#MAzqnDH A.1728@TK2MSFTN GP09.phx.gbl...[color=green]
                            > > Not having been a C++ programmer, I wonder if they promote a kind of
                            > > Stockholm Syndrome in their long-term users - you have to work with them[/color]
                            > so[color=green]
                            > > much and so long that you start to feel for them and sympathize with[/color][/color]
                            them[color=blue][color=green]
                            > > until you finally can't live without them.
                            > >
                            > > I have a difficult time imagining headers are better for separating
                            > > definition from implementation than an abstract class or interface.[/color][/color]
                            Both[color=blue][color=green]
                            > > are perfectly usable in the real world and both affect the total[/color]
                            > separation[color=green]
                            > > of implementation from structure.
                            > >
                            > > Richard
                            > >
                            > > --
                            > > Veuillez m'excuser, mon Fran$BmB(Bis est tr$BoT(B pauvre. Cependant, si vous[/color]
                            > voyez[color=green]
                            > > mauvais C #, c'est mon d$BqG(Baut!
                            > > "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
                            > > news:lq0ob.5962 9$Fm2.42234@att bi_s04...[color=darkred]
                            > > > Interesting, one of my favorite features of C#(and java, I suppose)[/color][/color][/color]
                            was[color=blue][color=green]
                            > > the[color=darkred]
                            > > > death of the header file.
                            > > >
                            > > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
                            > annoying[color=green][color=darkred]
                            > > > it was to have to double define methods, to have parameter lists and[/color]
                            > > return[color=darkred]
                            > > > types defined in TWO places, or my favorite in C, where if you forgot[/color][/color][/color]
                            to[color=blue][color=green][color=darkred]
                            > > > define a method the compiler couldn't find it... Hell, when I'm[/color][/color][/color]
                            writing[color=blue][color=green]
                            > > C++[color=darkred]
                            > > > code under 500 lines I'll often write my classes like I would in C#.
                            > > >
                            > > > I personally do not want to go back to these days, I would risk saying[/color]
                            > > that[color=darkred]
                            > > > it wasn't overlooked but turned down inherently.
                            > > >
                            > > > I guess I jsut don't like header files...I wonder what others think.
                            > > >
                            > > > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote[/color][/color]
                            > in[color=green][color=darkred]
                            > > > message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...
                            > > > > C# is great but it does have some short comings. Here, I examine one[/color][/color]
                            > of[color=green][color=darkred]
                            > > > them
                            > > > > which I definitely think is a shortcoming.
                            > > > > Coming from C++, there seems to be no equivalent in C# to separate[/color][/color]
                            > code[color=green][color=darkred]
                            > > > > cleanly for the user's benefit. Why is this important? Because a[/color][/color][/color]
                            user[color=blue][color=green]
                            > > gets[color=darkred]
                            > > > > to maintain this code, not a machine. C++ exposed us to header files[/color]
                            > > which[color=darkred]
                            > > > > was a way, among other things, to cleanly separate class[/color][/color]
                            > implementation[color=green][color=darkred]
                            > > > from
                            > > > > declaration. Why was this overlooked in C#? Mixing implementation[/color][/color][/color]
                            and[color=blue][color=green][color=darkred]
                            > > > > declaration inside a class is so ugly. Yuck!
                            > > > >
                            > > > > Sure intellisense can take you a long way, but it's a bandaid on a[/color]
                            > > bruise.[color=darkred]
                            > > > > Though it is possible to separate classes out into namespaces in C#[/color][/color]
                            > you[color=green][color=darkred]
                            > > > > still have to port the implementation with it. Yuck! A class can be
                            > > > > conceived without an implementation, if only for discussion[/color][/color][/color]
                            purposes.[color=blue][color=green]
                            > > You[color=darkred]
                            > > > > are not always interested in the implementation, that is why it is[/color][/color][/color]
                            so[color=blue][color=green][color=darkred]
                            > > > yucky.
                            > > > > What if you want to take the class function declarations with you to[/color][/color][/color]
                            a[color=blue][color=green][color=darkred]
                            > > > > meeting to talk about your new class? This does actually happen[/color][/color][/color]
                            quite[color=blue][color=green][color=darkred]
                            > > > > frequently. You can't do that in C# without intimately knowing the[/color][/color][/color]
                            cut[color=blue][color=green]
                            > > and[color=darkred]
                            > > > > paste editor. Intellisense can't help you there. A class has meaning
                            > > > outside
                            > > > > of the canvas it was carved on. A class does exist outside of the[/color][/color]
                            > visual[color=green][color=darkred]
                            > > > > studio GUI. Do not forget, there is no intellisense at the command[/color][/color]
                            > line.[color=green][color=darkred]
                            > > > > Probably higher level UML tools in C# builder will fit the bill, but
                            > > > that's
                            > > > > not the point. It should be part of the language implementation[/color][/color]
                            > because[color=green][color=darkred]
                            > > > > developers get to maintain that code. It's even more troublesome if[/color]
                            > > these[color=darkred]
                            > > > > UML solutions are not included in the box.
                            > > > >
                            > > > > We've all gotten used to this mess, and if you come from Java,[/color][/color][/color]
                            you've[color=blue][color=green][color=darkred]
                            > > > always
                            > > > > had it so it seems odd to be without it. But it doesn't make it[/color][/color][/color]
                            right.[color=blue][color=green][color=darkred]
                            > > > There
                            > > > > is (make that was) a better way. I remember that time when when
                            > > > > implementation and declaration were different beasts. Sure the[/color][/color]
                            > compiler[color=green][color=darkred]
                            > > > > could care less if the implementation was on the moon and[/color][/color][/color]
                            declaration[color=blue]
                            > on[color=green][color=darkred]
                            > > > > mars, but then again, a machine does not usually get to maintain[/color][/color][/color]
                            code[color=blue][color=green][color=darkred]
                            > > > right?
                            > > > > So it was never about the machine. It's about making life easy for
                            > > > > developers. C# has failed in this regard. A more difficult life
                            > > > maintaining
                            > > > > code means less productivity. Yes, it does make me less productive[/color][/color][/color]
                            if[color=blue]
                            > I[color=green][color=darkred]
                            > > > need
                            > > > > to figure out the moving parts of a class.
                            > > > >
                            > > > > I feel better now after venting.
                            > > > >
                            > > > > --
                            > > > >
                            > > > >
                            > > > > -----------
                            > > > > Got TidBits?
                            > > > > Get it here: www.networkip.net/tidbits
                            > > > >
                            > > > >
                            > > >
                            > > >[/color]
                            > >
                            > >[/color]
                            >
                            >[/color]


                            Comment

                            • Daniel O'Connell

                              #15
                              Re: C# code


                              "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
                              message news:%23Jc9T2vn DHA.3612@TK2MSF TNGP11.phx.gbl. ..[color=blue][color=green]
                              > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
                              annoying[color=blue][color=green]
                              > > it was to have to double define methods,[/color]
                              >
                              > No runtime allows double definition of methods, I'm sure I must have[/color]
                              missed[color=blue]
                              > your point. Would you care to clarify?. Overloaded methods are entirely
                              > different.
                              >[/color]
                              I mean, for example
                              //in a header file
                              void MyFunction(Stri ng *x);

                              //in my CPP file
                              void MyFunction(Stri ng *x)
                              {

                              }

                              then, I want to change MyFunction to MyFunction(Stri ng *x, int y); I have to
                              change the code in 2 places, which I find to be a bad design, two
                              definitions of the method that must match.[color=blue]
                              > --
                              >
                              >
                              > -----------
                              > Got TidBits?
                              > Get it here: www.networkip.net/tidbits
                              > "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in message
                              > news:lq0ob.5962 9$Fm2.42234@att bi_s04...[color=green]
                              > > Interesting, one of my favorite features of C#(and java, I suppose) was[/color]
                              > the[color=green]
                              > > death of the header file.
                              > >
                              > > I recently had to go write a MC++ class and got a reminder on how[/color][/color]
                              annoying[color=blue][color=green]
                              > > it was to have to double define methods, to have parameter lists and[/color]
                              > return[color=green]
                              > > types defined in TWO places, or my favorite in C, where if you forgot to
                              > > define a method the compiler couldn't find it... Hell, when I'm writing[/color]
                              > C++[color=green]
                              > > code under 500 lines I'll often write my classes like I would in C#.
                              > >
                              > > I personally do not want to go back to these days, I would risk saying[/color]
                              > that[color=green]
                              > > it wasn't overlooked but turned down inherently.
                              > >
                              > > I guess I jsut don't like header files...I wonder what others think.
                              > >
                              > > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote[/color][/color]
                              in[color=blue][color=green]
                              > > message news:%23VA%23bo pnDHA.2732@TK2M SFTNGP11.phx.gb l...[color=darkred]
                              > > > C# is great but it does have some short comings. Here, I examine one[/color][/color][/color]
                              of[color=blue][color=green]
                              > > them[color=darkred]
                              > > > which I definitely think is a shortcoming.
                              > > > Coming from C++, there seems to be no equivalent in C# to separate[/color][/color][/color]
                              code[color=blue][color=green][color=darkred]
                              > > > cleanly for the user's benefit. Why is this important? Because a user[/color][/color]
                              > gets[color=green][color=darkred]
                              > > > to maintain this code, not a machine. C++ exposed us to header files[/color][/color]
                              > which[color=green][color=darkred]
                              > > > was a way, among other things, to cleanly separate class[/color][/color][/color]
                              implementation[color=blue][color=green]
                              > > from[color=darkred]
                              > > > declaration. Why was this overlooked in C#? Mixing implementation and
                              > > > declaration inside a class is so ugly. Yuck!
                              > > >
                              > > > Sure intellisense can take you a long way, but it's a bandaid on a[/color][/color]
                              > bruise.[color=green][color=darkred]
                              > > > Though it is possible to separate classes out into namespaces in C#[/color][/color][/color]
                              you[color=blue][color=green][color=darkred]
                              > > > still have to port the implementation with it. Yuck! A class can be
                              > > > conceived without an implementation, if only for discussion purposes.[/color][/color]
                              > You[color=green][color=darkred]
                              > > > are not always interested in the implementation, that is why it is so[/color]
                              > > yucky.[color=darkred]
                              > > > What if you want to take the class function declarations with you to a
                              > > > meeting to talk about your new class? This does actually happen quite
                              > > > frequently. You can't do that in C# without intimately knowing the cut[/color][/color]
                              > and[color=green][color=darkred]
                              > > > paste editor. Intellisense can't help you there. A class has meaning[/color]
                              > > outside[color=darkred]
                              > > > of the canvas it was carved on. A class does exist outside of the[/color][/color][/color]
                              visual[color=blue][color=green][color=darkred]
                              > > > studio GUI. Do not forget, there is no intellisense at the command[/color][/color][/color]
                              line.[color=blue][color=green][color=darkred]
                              > > > Probably higher level UML tools in C# builder will fit the bill, but[/color]
                              > > that's[color=darkred]
                              > > > not the point. It should be part of the language implementation[/color][/color][/color]
                              because[color=blue][color=green][color=darkred]
                              > > > developers get to maintain that code. It's even more troublesome if[/color][/color]
                              > these[color=green][color=darkred]
                              > > > UML solutions are not included in the box.
                              > > >
                              > > > We've all gotten used to this mess, and if you come from Java, you've[/color]
                              > > always[color=darkred]
                              > > > had it so it seems odd to be without it. But it doesn't make it right.[/color]
                              > > There[color=darkred]
                              > > > is (make that was) a better way. I remember that time when when
                              > > > implementation and declaration were different beasts. Sure the[/color][/color][/color]
                              compiler[color=blue][color=green][color=darkred]
                              > > > could care less if the implementation was on the moon and declaration[/color][/color][/color]
                              on[color=blue][color=green][color=darkred]
                              > > > mars, but then again, a machine does not usually get to maintain code[/color]
                              > > right?[color=darkred]
                              > > > So it was never about the machine. It's about making life easy for
                              > > > developers. C# has failed in this regard. A more difficult life[/color]
                              > > maintaining[color=darkred]
                              > > > code means less productivity. Yes, it does make me less productive if[/color][/color][/color]
                              I[color=blue][color=green]
                              > > need[color=darkred]
                              > > > to figure out the moving parts of a class.
                              > > >
                              > > > I feel better now after venting.
                              > > >
                              > > > --
                              > > >
                              > > >
                              > > > -----------
                              > > > Got TidBits?
                              > > > Get it here: www.networkip.net/tidbits
                              > > >
                              > > >[/color]
                              > >
                              > >[/color]
                              >
                              >[/color]


                              Comment

                              Working...