Classes vs. Modules

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

    #76
    Re: Classes vs. Modules

    Yes, it was a response to Aaron Kempf. Otherwise, I didn't feel you guys
    needed any help discussing this issue; you were doing great without my
    input. ;-)

    Robin S.
    ---------------------------
    "Scott M." <s-mar@nospam.nosp amwrote in message
    news:uWeXABhTHH A.1228@TK2MSFTN GP06.phx.gbl...
    >I see this one. Perhaps you replied to someone that I have on my kill
    >list so I didn't see that branch!
    >
    >
    "RobinS" <RobinS@NoSpam. yah.nonewrote in message
    news:4MmdnTXaD6 2zJFPYnZ2dnUVZ_ tKjnZ2d@comcast .com...
    >There's only been one post by me (Robin) *in* this entire thread. Do you
    >see this one?
    >>
    >Robin S.
    >----------------------
    >"Scott M." <s-mar@nospam.nosp amwrote in message
    >news:OAHhyFZTH HA.4076@TK2MSFT NGP05.phx.gbl.. .
    >>Must have. I don't see anything from Robin in this entire thread.
    >>>
    >>>
    >>"Bruce W. Darby" <kracorat@atcom cast.netwrote in message
    >>news:e8GdnRTs gZVgw1PYnZ2dnUV Z_sWdnZ2d@comca st.com...
    >>>Not sure Scott. Are you seeing other posts by Robin? Or did you
    >>>inadvertentl y add him to your killfile?
    >>>>
    >>>"Scott M." <s-mar@nospam.nosp amwrote in message
    >>>news:OewPq6W THHA.1364@TK2MS FTNGP06.phx.gbl ...
    >>>>Hmmm, why don't I see Robin's message in this thread?
    >>>>>
    >>>>>
    >>>>"Bruce W. Darby" <kracorat@atcom cast.netwrote in message
    >>>>news:VPOdnf PnqumNpVPYnZ2dn UVZ_tunnZ2d@com cast.com...
    >>>>>I'll answer that for him, Robin.... because he CAN'T!! I'm coming to
    >>>>>the conclusion that our neophyte troll doesn't know how to program.
    >>>>>If he can't drag it and drop it, he's lost. Now, he COULD prove me
    >>>>>wrong, but I doubt that he'll even attempt to. :)
    >>>>>>
    >>>>>Bruce
    >>>>>>
    >>>>>"RobinS" <RobinS@NoSpam. yah.nonewrote in message
    >>>>>news:xsidn T6DOox6ilPYnZ2d nUVZ_vyunZ2d@co mcast.com...
    >>>>>>Why don't you post some code samples that show the same thing
    >>>>>>running in VB6 and VB2005 and show the performance statistics?
    >>>>>>>
    >>>>>>Robin S.
    >>>>>>Ts'i mahnu uterna ot twan ot geifur hingts uto.
    >>>>>>-----------------------------------------------
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

    Comment

    • Scott M.

      #77
      Re: Classes vs. Modules

      Ah, that must be it since I don't see any messages from Aaron either.


      "RobinS" <RobinS@NoSpam. yah.nonewrote in message
      news:TM-dnbWlhdLh71LYnZ 2dnUVZ_qunnZ2d@ comcast.com...
      Yes, it was a response to Aaron Kempf. Otherwise, I didn't feel you guys
      needed any help discussing this issue; you were doing great without my
      input. ;-)
      >
      Robin S.
      ---------------------------
      "Scott M." <s-mar@nospam.nosp amwrote in message
      news:uWeXABhTHH A.1228@TK2MSFTN GP06.phx.gbl...
      >>I see this one. Perhaps you replied to someone that I have on my kill
      >>list so I didn't see that branch!
      >>
      >>
      >"RobinS" <RobinS@NoSpam. yah.nonewrote in message
      >news:4MmdnTXaD 62zJFPYnZ2dnUVZ _tKjnZ2d@comcas t.com...
      >>There's only been one post by me (Robin) *in* this entire thread. Do you
      >>see this one?
      >>>
      >>Robin S.
      >>----------------------
      >>"Scott M." <s-mar@nospam.nosp amwrote in message
      >>news:OAHhyFZT HHA.4076@TK2MSF TNGP05.phx.gbl. ..
      >>>Must have. I don't see anything from Robin in this entire thread.
      >>>>
      >>>>
      >>>"Bruce W. Darby" <kracorat@atcom cast.netwrote in message
      >>>news:e8GdnRT sgZVgw1PYnZ2dnU VZ_sWdnZ2d@comc ast.com...
      >>>>Not sure Scott. Are you seeing other posts by Robin? Or did you
      >>>>inadvertent ly add him to your killfile?
      >>>>>
      >>>>"Scott M." <s-mar@nospam.nosp amwrote in message
      >>>>news:OewPq6 WTHHA.1364@TK2M SFTNGP06.phx.gb l...
      >>>>>Hmmm, why don't I see Robin's message in this thread?
      >>>>>>
      >>>>>>
      >>>>>"Bruce W. Darby" <kracorat@atcom cast.netwrote in message
      >>>>>news:VPOdn fPnqumNpVPYnZ2d nUVZ_tunnZ2d@co mcast.com...
      >>>>>>I'll answer that for him, Robin.... because he CAN'T!! I'm coming to
      >>>>>>the conclusion that our neophyte troll doesn't know how to program.
      >>>>>>If he can't drag it and drop it, he's lost. Now, he COULD prove me
      >>>>>>wrong, but I doubt that he'll even attempt to. :)
      >>>>>>>
      >>>>>>Bruce
      >>>>>>>
      >>>>>>"RobinS " <RobinS@NoSpam. yah.nonewrote in message
      >>>>>>news:xsid nT6DOox6ilPYnZ2 dnUVZ_vyunZ2d@c omcast.com...
      >>>>>>>Why don't you post some code samples that show the same thing
      >>>>>>>runnin g in VB6 and VB2005 and show the performance statistics?
      >>>>>>>>
      >>>>>>>Robin S.
      >>>>>>>Ts'i mahnu uterna ot twan ot geifur hingts uto.
      >>>>>>>-----------------------------------------------
      >>>>>>>
      >>>>>>>
      >>>>>>
      >>>>>>
      >>>>>
      >>>>>
      >>>>
      >>>>
      >>>
      >>>
      >>
      >>
      >
      >

      Comment

      • RobinS

        #78
        Re: Classes vs. Modules

        And I bet you miss that, don't you? ;-)

        Robin S.
        -----------------------------
        "Scott M." <s-mar@nospam.nosp amwrote in message
        news:ebNj1HkTHH A.4404@TK2MSFTN GP03.phx.gbl...
        Ah, that must be it since I don't see any messages from Aaron either.
        >
        >
        "RobinS" <RobinS@NoSpam. yah.nonewrote in message
        news:TM-dnbWlhdLh71LYnZ 2dnUVZ_qunnZ2d@ comcast.com...
        >Yes, it was a response to Aaron Kempf. Otherwise, I didn't feel you guys
        >needed any help discussing this issue; you were doing great without my
        >input. ;-)
        >>
        >Robin S.
        >---------------------------
        >"Scott M." <s-mar@nospam.nosp amwrote in message
        >news:uWeXABhTH HA.1228@TK2MSFT NGP06.phx.gbl.. .
        >>>I see this one. Perhaps you replied to someone that I have on my kill
        >>>list so I didn't see that branch!
        >>>
        >>>
        >>"RobinS" <RobinS@NoSpam. yah.nonewrote in message
        >>news:4MmdnTXa D62zJFPYnZ2dnUV Z_tKjnZ2d@comca st.com...
        >>>There's only been one post by me (Robin) *in* this entire thread. Do
        >>>you see this one?
        >>>>
        >>>Robin S.
        >>>----------------------
        >>>"Scott M." <s-mar@nospam.nosp amwrote in message
        >>>news:OAHhyFZ THHA.4076@TK2MS FTNGP05.phx.gbl ...
        >>>>Must have. I don't see anything from Robin in this entire thread.
        >>>>>
        >>>>>
        >>>>"Bruce W. Darby" <kracorat@atcom cast.netwrote in message
        >>>>news:e8GdnR TsgZVgw1PYnZ2dn UVZ_sWdnZ2d@com cast.com...
        >>>>>Not sure Scott. Are you seeing other posts by Robin? Or did you
        >>>>>inadverten tly add him to your killfile?
        >>>>>>
        >>>>>"Scott M." <s-mar@nospam.nosp amwrote in message
        >>>>>news:OewPq 6WTHHA.1364@TK2 MSFTNGP06.phx.g bl...
        >>>>>>Hmmm, why don't I see Robin's message in this thread?
        >>>>>>>
        >>>>>>>
        >>>>>>"Bruce W. Darby" <kracorat@atcom cast.netwrote in message
        >>>>>>news:VPOd nfPnqumNpVPYnZ2 dnUVZ_tunnZ2d@c omcast.com...
        >>>>>>>I'll answer that for him, Robin.... because he CAN'T!! I'm coming
        >>>>>>>to the conclusion that our neophyte troll doesn't know how to
        >>>>>>>progra m. If he can't drag it and drop it, he's lost. Now, he COULD
        >>>>>>>prove me wrong, but I doubt that he'll even attempt to. :)
        >>>>>>>>
        >>>>>>>Bruce
        >>>>>>>>
        >>>>>>>"Robin S" <RobinS@NoSpam. yah.nonewrote in message
        >>>>>>>news:xsi dnT6DOox6ilPYnZ 2dnUVZ_vyunZ2d@ comcast.com...
        >>>>>>>>Why don't you post some code samples that show the same thing
        >>>>>>>>runni ng in VB6 and VB2005 and show the performance statistics?
        >>>>>>>>>
        >>>>>>>>Robin S.
        >>>>>>>>Ts'i mahnu uterna ot twan ot geifur hingts uto.
        >>>>>>>>-----------------------------------------------
        >>>>>>>>
        >>>>>>>>
        >>>>>>>
        >>>>>>>
        >>>>>>
        >>>>>>
        >>>>>
        >>>>>
        >>>>
        >>>>
        >>>
        >>>
        >>
        >>
        >
        >

        Comment

        • Zytan

          #79
          Re: Classes vs. Modules

          My point is that a class (in Dutch the word is almost the same and has the
          same meaning as in English) tells something about a type. A shared class
          tells nothing, it is a stand alone object not something that describes a
          group.
          >
          A module is a much better name for me for that.
          >
          For me it is more that it is not the right word in C languages as well. I
          would propose to call it there as well modules.
          >
          Cor
          I agree with this. Classes are types. Modules are just a list of
          functions, there is no type. I think C languages should have this
          term, as well. It suits what it actually is much better. (Or...
          allow classes to 'be' modules in that sense, without required 'hacks'
          by making everything 'shared' / 'static'. I think a new name, Module,
          is better than this idea.)

          But... am I just stupid, or do Modules place everything into the
          global namespace? This is what I dislike about them. So, I'll use
          classes, instead, for this one reason alone.

          Zytan


          Comment

          • Zytan

            #80
            Re: Classes vs. Modules

            VB6 was pre-.Net. Technically, it had classes, but not true OO
            capabilities.
            >
            Robin S.
            Understood. Thanks for the replies everyone.

            Zytan


            Comment

            • Branco Medeiros

              #81
              Re: Classes vs. Modules

              Zytan wrote:
              <snip>
              do Modules place everything into the
              global namespace? This is what I dislike about them. So, I'll use
              classes, instead, for this one reason alone.
              <snip>

              Yes, modules do put all public elements in the "global" namespace they
              belong.

              Note, however, that while a module is usually placed at the project's
              namespace, it doesn't need to be so. A module in a specific namespace
              won't appear globally in the project's namespace, only in the
              immediate namespace the module is contained. Outside the namespace
              you'd still need to prefix the method call with the namespace -- or
              import the namespace altogether.

              <aircode>
              Namespace Globals
              Module SomeModule
              Sub SomeSub
              '...
              End Sub
              End Module
              End Module

              Class SomeClass
              Sub New
              SomeSub '<-- Error
              Globals.SomeSub '<-- Ok
              Globals.SomeMod ule.SomeSub '<-- Ok, also
              End Sub
              End Class

              'In another file
              Imports Globals

              Class SomeOtherClass
              Sub New
              SomeSub '<-- Ok
              SomeModule.Some Sub '<-- ditto
              End Sub
              End Class
              </aircode>

              If this behavior isn't what you want, I suggest you use shared methods
              in classes, then.

              On the other side, if "global" methods is exactly what you want, or
              you don't care because you'd Import the class anyway (making the
              shared methods global), or still, you want global methods inside a
              specific namespace, then go ahead and use a module, instead.

              HTH.

              Regards,

              Branco.

              Comment

              • Zytan

                #82
                Re: Classes vs. Modules

                Yes, modules do put all public elements in the "global" namespace they
                belong.
                >
                Note, however, that while a module is usually placed at the project's
                namespace, it doesn't need to be so. A module in a specific namespace
                won't appear globally in the project's namespace, only in the
                immediate namespace the module is contained. Outside the namespace
                you'd still need to prefix the method call with the namespace -- or
                import the namespace altogether.
                >
                <snip>
                >
                If this behavior isn't what you want, I suggest you use shared methods
                in classes, then.
                >
                On the other side, if "global" methods is exactly what you want, or
                you don't care because you'd Import the class anyway (making the
                shared methods global), or still, you want global methods inside a
                specific namespace, then go ahead and use a module, instead.
                >
                HTH.
                Branco, yes, this helps a lot. Thanks for your very informative
                post. I had thought about making modules in namespaces, but I am not
                comfortable with it due to lack of experience. But, I can see how
                this helps. I guess the lack of need to use the module name itself
                throws me off, even in this case. Yes, the namespace is required
                (unless you use Imports), but the module name can always be missing.
                I suppose most people use Imports for many things, though, and they
                are used to this.

                In any case, thanks for the in depth reply.

                Zytan

                Comment

                • Branco Medeiros

                  #83
                  Re: Classes vs. Modules

                  Zytan wrote:
                  <snip>
                  I guess the lack of need to use the module name itself
                  throws me off, even in this case. Yes, the namespace is required
                  (unless you use Imports), but the module name can always be missing.
                  I suppose most people use Imports for many things, though, and they
                  are used to this.
                  <snip>

                  I think that simply importing a namespace into the file is evil (or
                  something close to it). My (personal, mind you) rule of thumb is, if I
                  must use Imports, then I must create an alias to it:

                  Imports SysThread = System.Threadin g
                  Imports SysRegex = System.Text.Reg ularExpression

                  As opposed to:

                  Imports System.Threadin g
                  Imports System.Text.Reg ularExpression

                  Don't know if this relates to what you're talking about, and my
                  apologies if it drifts to OT.

                  Regards,

                  Branco.

                  Comment

                  • aaron.kempf@gmail.com

                    #84
                    Re: Classes vs. Modules

                    that would sure be interesting to me

                    so I can make a class named 'aaron' and I can put functions in it..
                    and I can reuse those functions without instantiating a class?

                    I just don't like all of the dependencies between that style of
                    writing; it makes me sick to think about it


                    Comment

                    • aaron.kempf@gmail.com

                      #85
                      Re: Classes vs. Modules

                      I don't need to

                      startup a vb6 forms app.. and startup a vb 2005 forms app

                      it's obvious to me which is faster


                      Comment

                      • aaron.kempf@gmail.com

                        #86
                        Re: Classes vs. Modules

                        clutter the global namespace?

                        are you fucking kidding me?

                        does this make the app slower?

                        does it make carol in accounting enter data _FASTER_ ??

                        Comment

                        • aaron.kempf@gmail.com

                          #87
                          Re: Classes vs. Modules

                          yeah

                          module aaron

                          module matt

                          I can refer to aaron.method1 or matt.method2 just as easily as with a
                          class; but I don't need to instantiate an instance of the class first


                          Comment

                          • aaron.kempf@gmail.com

                            #88
                            Re: Classes vs. Modules

                            Cor

                            I strongly

                            I militantly, agree

                            80% of VB6 developers 'never used a class' why did we need to get this
                            crap shoved down our throats?

                            Comment

                            • aaron.kempf@gmail.com

                              #89
                              Re: Classes vs. Modules

                              are you fuckin kidding me bro?

                              you think that vb6 was build on a prior version of the .net runtime?

                              ROFL

                              yeah, vb6 had classes; it didn't support inheritence

                              but I'm over it

                              taking a module and pasting it into a class and adding 2 lines of code
                              does _NOTHING_ for you.
                              I had a co-worker who used to do that and my stupid fucking manager
                              thought that he was such a great programmer--- because he used clases

                              and I was like 'uh, he has no error-handling, he has no structure, no
                              consistency'

                              and she didn't give a crap; all she liked was that it was a class

                              it kinda blew my mind; I thoght that it wa hilarious

                              he would take a module and paste it into a class without rewriting the
                              module into logical methods; he wouldn't even make anything private;
                              it was the ugliest code i've ever seen in my life

                              little prissy kid named 'craig'

                              Comment

                              • aaron.kempf@gmail.com

                                #90
                                Re: Classes vs. Modules

                                lloyd

                                I just said that 80% of vb6 programmers 'never used a class'

                                why did we need to get enlightened?

                                does moving to classes make our code faster?

                                Comment

                                Working...