VB vs C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel O'Connell [C# MVP]

    #91
    Re: VB vs C#


    "Jeremy Todd" <jhtodd@uiuc.ed u> wrote in message
    news:O5L1eH0IEH A.3528@TK2MSFTN GP09.phx.gbl...[color=blue]
    > "Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
    > message news:u4cTz9zIEH A.2128@TK2MSFTN GP11.phx.gbl...
    >[color=green]
    >> Yes, but I'd argue that IMass.Mass and IWeight.Weight, even if they work[/color]
    > the[color=green]
    >> same in one situation, are entirely different and as a matter of
    >> understanding using the same method to implement them isn't going to make
    >> code that makes immediate sense. Although I can't think of a physics[/color]
    > example[color=green]
    >> to qualify it. Once you do that, how do you seperate them again in a[/color]
    > derived[color=green]
    >> class? You could say I don't like the conceptual muxing of different
    >> ideas
    >> for convenience.[/color]
    >
    > Yes, this was discussed at length. :) In the end, we decided the pros
    > and cons slightly favored doing it my way, because the class hierarchy was
    > determined early on and we knew well in advance how each class would
    > behave.
    >[color=green]
    >> How often are non-public interfaces on public types a good idea? IMHO not
    >> very often. ;) You should be designing your architecture so that public
    >> types contain mostly publically accessible functionality(o r underlying
    >> protected functionality for virtuality). However, that is my personal
    >> POV.[/color]
    >
    > I don't follow. How is the use of non-public interfaces different from
    > non-public class members? Are you also opposed to private fields and
    > methods? :)
    >[/color]
    Merely that they are interfaces. Its not so much a necessity as a goal I
    strive to reach. I don't like to implement internal interfaces on public
    classes, I'd rather rely on managers\factor ies and implement the interfaces
    there and write the public classes without interfaces designed for internal
    usage.
    I also do my best to avoid designs which rely on internal members(I can't
    think of the VB keyword for this, but assembly only access). They are a
    nessecery evil in many cases, but something I always look for other ways
    around. I don't mean that protected methods or private method(which usually
    are helpers for public or protected methods) shouldn't exist, just that when
    possible an interface should strive to be public and if a class can't expose
    all its externally required behaviour publically there is probably a better
    design available. However, this is a guideline I try to follow, not a
    steadfast rule; I have written more than one internal interface\metho d in my
    lifetime.[color=blue]
    > Jeremy
    >[/color]


    Comment

    • Cor Ligthert

      #92
      Re: VB vs C#

      Hi Jon,[color=blue]
      >
      > General readability. There seems absolutely no need for it, and it
      > makes the context of a statement harder to see.[/color]

      Although we agree this one completely, is this the same as using distinction
      between upper and lowercase in C derived languages (and a lot more older
      languages).

      You are not obligated to use it.

      Cor



      Comment

      • Cor Ligthert

        #93
        Re: VB vs C#

        Hi Jon,[color=blue]
        >
        > General readability. There seems absolutely no need for it, and it
        > makes the context of a statement harder to see.[/color]

        Although we agree this one completely, is this the same as using distinction
        between upper and lowercase in C derived languages (and a lot more older
        languages).

        You are not obligated to use it.

        Cor



        Comment

        • Jon Skeet [C# MVP]

          #94
          Re: VB vs C#

          Cor Ligthert <notfirstname@p lanet.nl> wrote:[color=blue][color=green]
          > > General readability. There seems absolutely no need for it, and it
          > > makes the context of a statement harder to see.[/color]
          >
          > Although we agree this one completely, is this the same as using distinction
          > between upper and lowercase in C derived languages (and a lot more older
          > languages).
          >
          > You are not obligated to use it.[/color]

          That's never a good enough reason, IMO - if a feature is present,
          people *will* use it, and like it or not, we don't always read code
          that we've written ourselves.

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

          • Jon Skeet [C# MVP]

            #95
            Re: VB vs C#

            Cor Ligthert <notfirstname@p lanet.nl> wrote:[color=blue][color=green]
            > > General readability. There seems absolutely no need for it, and it
            > > makes the context of a statement harder to see.[/color]
            >
            > Although we agree this one completely, is this the same as using distinction
            > between upper and lowercase in C derived languages (and a lot more older
            > languages).
            >
            > You are not obligated to use it.[/color]

            That's never a good enough reason, IMO - if a feature is present,
            people *will* use it, and like it or not, we don't always read code
            that we've written ourselves.

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

            • Cor Ligthert

              #96
              Re: VB vs C#

              Hi Jon,

              There is a very simple question in the VB.language group, almost everybody
              was busy with it.
              There is this sentence in.
              dialogresult = me.show

              My answer was this is not possible, when you want to do that it should be
              with a new created form and a showdialog.

              I did not understand how he would do this. Now he says he got the program
              from someone else and it is to complex for him to read. I think there is
              something in that program as.
              \\\
              Shadows Sub Show()
              Dim frm As New Form2
              Dim result As DialogResult
              result = frm.ShowDialog( )
              End Sub
              Private Sub Button1_Click(B yVal sender As System.Object, _
              ByVal e As System.EventArg s) Handles Button1.Click
              Me.Hide()
              Me.Show()
              Me.Button1.Pare nt.Show()
              End Sub
              ///

              I told that if this is true that he was working in my idea, as I call them,
              by the
              maker obfuscated program.

              Maybe it is not this code or something (I see now that it should be minimal
              a function with a return of the result) however than you are talking about
              the "with". Which what I said we agree. (second time in two days)

              :-)

              Cor


              Comment

              • Cor Ligthert

                #97
                Re: VB vs C#

                I hope you understand the last row of this message, I see now, that I
                corrected it to often.

                The meaning is.
                Maybe it is not exactly this code what is made (I see now too that it should
                be minimal function with a return of the result)

                However if it is this kind of code why should we than talk about the "with"/

                Cor


                Comment

                • Cor Ligthert

                  #98
                  Re: VB vs C#

                  Hi Jon,

                  There is a very simple question in the VB.language group, almost everybody
                  was busy with it.
                  There is this sentence in.
                  dialogresult = me.show

                  My answer was this is not possible, when you want to do that it should be
                  with a new created form and a showdialog.

                  I did not understand how he would do this. Now he says he got the program
                  from someone else and it is to complex for him to read. I think there is
                  something in that program as.
                  \\\
                  Shadows Sub Show()
                  Dim frm As New Form2
                  Dim result As DialogResult
                  result = frm.ShowDialog( )
                  End Sub
                  Private Sub Button1_Click(B yVal sender As System.Object, _
                  ByVal e As System.EventArg s) Handles Button1.Click
                  Me.Hide()
                  Me.Show()
                  Me.Button1.Pare nt.Show()
                  End Sub
                  ///

                  I told that if this is true that he was working in my idea, as I call them,
                  by the
                  maker obfuscated program.

                  Maybe it is not this code or something (I see now that it should be minimal
                  a function with a return of the result) however than you are talking about
                  the "with". Which what I said we agree. (second time in two days)

                  :-)

                  Cor


                  Comment

                  • Jon Skeet [C# MVP]

                    #99
                    Re: VB vs C#

                    Cor Ligthert <notfirstname@p lanet.nl> wrote:[color=blue]
                    > There is a very simple question in the VB.language group, almost everybody
                    > was busy with it.
                    > There is this sentence in.
                    > dialogresult = me.show
                    >
                    > My answer was this is not possible, when you want to do that it should be
                    > with a new created form and a showdialog.[/color]

                    What was not possible? Sorry, you haven't said what the actual question
                    was...
                    [color=blue]
                    > I did not understand how he would do this. Now he says he got the program
                    > from someone else and it is to complex for him to read. I think there is
                    > something in that program as.
                    > \\\
                    > Shadows Sub Show()
                    > Dim frm As New Form2
                    > Dim result As DialogResult
                    > result = frm.ShowDialog( )
                    > End Sub
                    > Private Sub Button1_Click(B yVal sender As System.Object, _
                    > ByVal e As System.EventArg s) Handles Button1.Click
                    > Me.Hide()
                    > Me.Show()
                    > Me.Button1.Pare nt.Show()
                    > End Sub
                    > ///
                    >
                    > I told that if this is true that he was working in my idea, as I call them,
                    > by the maker obfuscated program.
                    >
                    > Maybe it is not this code or something (I see now that it should be minimal
                    > a function with a return of the result) however than you are talking about
                    > the "with". Which what I said we agree. (second time in two days)[/color]

                    I'm afraid I really didn't follow any of that... what point were you
                    trying to make again?

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

                    • Cor Ligthert

                      Re: VB vs C#

                      I hope you understand the last row of this message, I see now, that I
                      corrected it to often.

                      The meaning is.
                      Maybe it is not exactly this code what is made (I see now too that it should
                      be minimal function with a return of the result)

                      However if it is this kind of code why should we than talk about the "with"/

                      Cor


                      Comment

                      • Jon Skeet [C# MVP]

                        Re: VB vs C#

                        Cor Ligthert <notfirstname@p lanet.nl> wrote:[color=blue]
                        > I hope you understand the last row of this message, I see now, that I
                        > corrected it to often.
                        >
                        > The meaning is.
                        > Maybe it is not exactly this code what is made (I see now too that it should
                        > be minimal function with a return of the result)
                        >
                        > However if it is this kind of code why should we than talk about the "with"/[/color]

                        If *what* is this kind of code?

                        I believe that With promotes less readable code, and therefore C# is
                        better without it. Just because you *can* write unreadable code in any
                        language doesn't mean that the language should encourage you to do so.

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

                        • Jon Skeet [C# MVP]

                          Re: VB vs C#

                          Cor Ligthert <notfirstname@p lanet.nl> wrote:[color=blue]
                          > There is a very simple question in the VB.language group, almost everybody
                          > was busy with it.
                          > There is this sentence in.
                          > dialogresult = me.show
                          >
                          > My answer was this is not possible, when you want to do that it should be
                          > with a new created form and a showdialog.[/color]

                          What was not possible? Sorry, you haven't said what the actual question
                          was...
                          [color=blue]
                          > I did not understand how he would do this. Now he says he got the program
                          > from someone else and it is to complex for him to read. I think there is
                          > something in that program as.
                          > \\\
                          > Shadows Sub Show()
                          > Dim frm As New Form2
                          > Dim result As DialogResult
                          > result = frm.ShowDialog( )
                          > End Sub
                          > Private Sub Button1_Click(B yVal sender As System.Object, _
                          > ByVal e As System.EventArg s) Handles Button1.Click
                          > Me.Hide()
                          > Me.Show()
                          > Me.Button1.Pare nt.Show()
                          > End Sub
                          > ///
                          >
                          > I told that if this is true that he was working in my idea, as I call them,
                          > by the maker obfuscated program.
                          >
                          > Maybe it is not this code or something (I see now that it should be minimal
                          > a function with a return of the result) however than you are talking about
                          > the "with". Which what I said we agree. (second time in two days)[/color]

                          I'm afraid I really didn't follow any of that... what point were you
                          trying to make again?

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

                          • cody

                            Re: VB vs C#

                            > > Using the keyword class for other purposes than declaring a class was my[color=blue][color=green]
                            > > idea too a few weeks ago.
                            > > I wanted to use it to get the current type of the class:
                            > >[/color]
                            > Yes, I remember. It was actually what finally gave me the bit of syntax I
                            > needed for deciding on this.[color=green]
                            > > static void Foo()
                            > > {
                            > > Type t = class
                            > > Console.Writeli ne("Iam declared in " + t);
                            > > }
                            > >[/color]
                            >
                            > I would rather see typeof(class) over just assigning class.[/color]

                            Yes thats what I meant, I just forgot the typeof().
                            [color=blue][color=green]
                            > > Since GetType() is not available in static methods and hardcoding the
                            > > class
                            > > via typeof(MyClass) is errorprone and confusing,
                            > > I find using "class" here is completely fine.[/color][/color]

                            --
                            cody

                            Freeware Tools, Games and Humour
                            http://www.deutronium.de.vu || http://www.deutronium.tk


                            Comment

                            • Jon Skeet [C# MVP]

                              Re: VB vs C#

                              Cor Ligthert <notfirstname@p lanet.nl> wrote:[color=blue]
                              > I hope you understand the last row of this message, I see now, that I
                              > corrected it to often.
                              >
                              > The meaning is.
                              > Maybe it is not exactly this code what is made (I see now too that it should
                              > be minimal function with a return of the result)
                              >
                              > However if it is this kind of code why should we than talk about the "with"/[/color]

                              If *what* is this kind of code?

                              I believe that With promotes less readable code, and therefore C# is
                              better without it. Just because you *can* write unreadable code in any
                              language doesn't mean that the language should encourage you to do so.

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

                              • cody

                                Re: VB vs C#

                                > > Using the keyword class for other purposes than declaring a class was my[color=blue][color=green]
                                > > idea too a few weeks ago.
                                > > I wanted to use it to get the current type of the class:
                                > >[/color]
                                > Yes, I remember. It was actually what finally gave me the bit of syntax I
                                > needed for deciding on this.[color=green]
                                > > static void Foo()
                                > > {
                                > > Type t = class
                                > > Console.Writeli ne("Iam declared in " + t);
                                > > }
                                > >[/color]
                                >
                                > I would rather see typeof(class) over just assigning class.[/color]

                                Yes thats what I meant, I just forgot the typeof().
                                [color=blue][color=green]
                                > > Since GetType() is not available in static methods and hardcoding the
                                > > class
                                > > via typeof(MyClass) is errorprone and confusing,
                                > > I find using "class" here is completely fine.[/color][/color]

                                --
                                cody

                                Freeware Tools, Games and Humour
                                http://www.deutronium.de.vu || http://www.deutronium.tk


                                Comment

                                Working...