OOP Programming in VB.NET

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

    #1

    OOP Programming in VB.NET

    Hello,

    Where can I learn OOP programming on-line? I come from old fashion coding
    which you can see below:



    It seem that I need to do OOP if decide to continue my programming career in
    VB. Any suggestions in doing OOP in VB.NET ?

    Thanks!

    Sharrukin


  • Francois

    #2
    RE: OOP Programming in VB.NET

    Hi,

    Maybe not OPP specific enough but...

    http://msdn.microsoft.com/vbasic/com...n/default.aspx

    Very well rounded "introducti on+" to vb .net... a fifteen session web cast.

    "Sharrukin Amiri" wrote:
    [color=blue]
    > Hello,
    >
    > Where can I learn OOP programming on-line? I come from old fashion coding
    > which you can see below:
    >
    > http://www.amtekcenter.com/amtek/wdwscode.htm
    >
    > It seem that I need to do OOP if decide to continue my programming career in
    > VB. Any suggestions in doing OOP in VB.NET ?
    >
    > Thanks!
    >
    > Sharrukin
    >
    >
    >[/color]

    Comment

    • Cor Ligthert

      #3
      Re: OOP Programming in VB.NET

      Sharrukin,

      I answered you in the language vb newsgroup with this message.



      Sadly enough there was somebody who told that my advice, not to set
      everything global, was wrong. His reason was that the GC took an
      unpredictable time to clean up and therefore the memory would not direct be
      released. His message could be read, that he suggested that the time that
      the GC would do this, could be after a very long time and that it therefore
      is better to set everything global.

      There were no comments on his message beside from me. Therefore when
      somebody sees this and will give an second opinion on that, than I will be
      glad.

      In addition, to make my message more clear. Don't bother now about OOP
      programming in VBNet. You cannot do it without that. Especially not because
      I have looked to your code from begin to end and all ingredients are there,
      which makes me sure that you will use that very soon after your start.

      I hope this helps,

      Cor


      Comment

      • Michael D. Ober

        #4
        Re: OOP Programming in VB.NET

        Cor,

        I agree with you to avoid global variables. Globals tend to make code far
        more difficult to debug.

        According to MS, there are three starting points for the .NET GC mark
        phase - the global variable pool, the runtime stack (for each thread), and
        an additional set of "dirty" object references. Putting all your variables
        in the global pool simply increases the size of the global pool and forces
        the GC to spend more time in this pool. Local variables, on the other hand,
        go on the stack. If you are deeply nested, it may take longer to process
        the stack, but this is where the "dirty" object reference optimization in
        ..NET comes in. .NET's GC is smart enough to not do the mark pass on objects
        that survived the previous GC pass unless your code writes to those objects.
        By keeping your variables local, your code is much less likely to update
        variables that survived previous GC passes.

        Sharrukin,

        If you are really concerned with the performance of your code to the extent
        that you need to be able to predict how long a function will take to
        execute, Windows isn't the answer. You need a real time operating system.
        If you simply want to make sure there aren't long, user noticable, pauses in
        your program due to GC activities, use local variables. Microsoft
        recommends against intermediate lifetime objects as these are the ones that
        will defeat the "dirty" object reference optimizations. Short lived objects
        will get reclaimed on their next pass. Program lifetime lived objects will
        never get reclaimed, even if they aren't being used. Use globals only if
        required. Use locals for everything else. This will make your code a lot
        easier to understand and debug. The other optimization that Microsoft
        recommends is to implements your objects so that they don't need to
        implement the IDisposable interface, as this prevents an object from being
        reclaimed on the first pass. The GC puts these objects on a Finalize list
        that then gets processed by a single thread after the GC completes it's pass
        and restarts application threads. A large number of objects on the Finalize
        list can lead to a lot of "dirty" object references being generated.

        Mike Ober.


        "Cor Ligthert" <notmyfirstname @planet.nl> wrote in message
        news:Oom6kIfWFH A.1044@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Sharrukin,
        >
        > I answered you in the language vb newsgroup with this message.
        >
        >[/color]
        http://groups-beta.google.com/group/...b445be8c?hl=en[color=blue]
        >
        > Sadly enough there was somebody who told that my advice, not to set
        > everything global, was wrong. His reason was that the GC took an
        > unpredictable time to clean up and therefore the memory would not direct[/color]
        be[color=blue]
        > released. His message could be read, that he suggested that the time that
        > the GC would do this, could be after a very long time and that it[/color]
        therefore[color=blue]
        > is better to set everything global.
        >
        > There were no comments on his message beside from me. Therefore when
        > somebody sees this and will give an second opinion on that, than I will be
        > glad.
        >
        > In addition, to make my message more clear. Don't bother now about OOP
        > programming in VBNet. You cannot do it without that. Especially not[/color]
        because[color=blue]
        > I have looked to your code from begin to end and all ingredients are[/color]
        there,[color=blue]
        > which makes me sure that you will use that very soon after your start.
        >
        > I hope this helps,
        >
        > Cor
        >
        >
        >[/color]



        Comment

        • Sharrukin Amiri

          #5
          Re: OOP Programming in VB.NET

          Thank you Cor for your help!

          Sharrukin


          "Cor Ligthert" <notmyfirstname @planet.nl> wrote in message
          news:Oom6kIfWFH A.1044@TK2MSFTN GP10.phx.gbl...[color=blue]
          > Sharrukin,
          >
          > I answered you in the language vb newsgroup with this message.
          >
          >[/color]

          /cd6d8fdab445be8 c?hl=en[color=blue]
          >
          > Sadly enough there was somebody who told that my advice, not to set
          > everything global, was wrong. His reason was that the GC took an
          > unpredictable time to clean up and therefore the memory would not direct[/color]
          be[color=blue]
          > released. His message could be read, that he suggested that the time that
          > the GC would do this, could be after a very long time and that it[/color]
          therefore[color=blue]
          > is better to set everything global.
          >
          > There were no comments on his message beside from me. Therefore when
          > somebody sees this and will give an second opinion on that, than I will be
          > glad.
          >
          > In addition, to make my message more clear. Don't bother now about OOP
          > programming in VBNet. You cannot do it without that. Especially not[/color]
          because[color=blue]
          > I have looked to your code from begin to end and all ingredients are[/color]
          there,[color=blue]
          > which makes me sure that you will use that very soon after your start.
          >
          > I hope this helps,
          >
          > Cor
          >
          >[/color]


          Comment

          Working...