Modular Programming...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jay B. Harlow [MVP - Outlook]

    #16
    Re: Modular Programming...

    Don,
    As I mentioned, I find smaller routines are better. Rather then have one
    long routine, I tend to have many smaller routines. With smaller routines in
    most cases you will probably have better code reuse.

    With smaller routines, you don't need to hide code within the routine
    itself, using the options on the outlining menu, you can hide or unhide the
    routine bodies...

    Hope this helps
    Jay

    "I_AM_DON_AND_Y OU?" <user@domain.co m> wrote in message
    news:eCC8%236lm DHA.1408@TK2MSF TNGP11.phx.gbl. ..[color=blue]
    > Thanks. I will use this "Region...E nd Region.." structure.
    >
    > Also, do you have any (similar) idea to hide/unhide the code within one
    > procedure.
    >
    >
    >
    > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in[/color]
    message[color=blue]
    > news:ui8wRqlmDH A.2000@TK2MSFTN GP12.phx.gbl...[color=green]
    > > Don,
    > > You can use #regions to group related handlers into collapsible sections[/color]
    > of[color=green]
    > > code.
    > >
    > > For example in the form I have open right now. I have
    > >
    > > #Region " File menu support "
    > >
    > > Private Sub menuFileClose_C lick(...) Handles menuFileClose.C lick
    > > me.Close()
    > > End Sub
    > >
    > > ...
    > >
    > > #End Region
    > >
    > > #Region " View menu support "
    > > ...
    > >
    > > #End Region
    > >
    > > Where the first region has all the event handlers for the file menu,[/color][/color]
    while[color=blue][color=green]
    > > the second region has all the event handlers for the view menu.
    > >
    > > When I open the above form in Code view, both of the above sections are
    > > collapsed by default. If I need to work on the File Menu I open that
    > > section, if I need to work on the View menu I open that section.
    > >
    > > You could put your button click handlers into similar sections. Either a
    > > single section, individual sections or grouped logically.
    > >
    > > Also, "Edit - Outlining" has a number of options to show or hide[/color][/color]
    routines.[color=blue]
    > I[color=green]
    > > use "Collapse to Definitions" and "Toggle all Outlining" on the "Edit -
    > > Outlining" routinely, to help find which routine I want to work on, then[/color][/color]
    I[color=blue][color=green]
    > > manually expand that one routine.
    > >
    > > Hope this helps
    > > Jay
    > >
    > > "I_AM_DON_AND_Y OU?" <user@domain.co m> wrote in message
    > > news:OjfkBflmDH A.1244@TK2MSFTN GP11.phx.gbl...[color=darkred]
    > > > You wrote:
    > > > ".............. You can use #region within your form's code to help[/color]
    > > organize[color=darkred]
    > > > the event handlers....."
    > > >
    > > > Could you tell me how it helps us to organize event handlers.
    > > >
    > > > Thanks!
    > > >
    > > >
    > > >
    > > >
    > > >[/color]
    > >
    > >[/color]
    >
    >[/color]


    Comment

    • Cor

      #17
      Re: Modular Programming...

      Hi Jay B,

      Lets start with, we totaly agree. But I have a question. I am of course from
      an old fashion time.

      What I have always thought was that modulair programming was to divide your
      project in managable structures, with reusable code in all parts of your
      project.

      The best way to do that is in my eyes is using OOP techniques.

      When I reads this kinds of threads I always think. Modulair programming is
      translated as using old fashion VB modules, which have in my eyes nothing to
      do with modulair programming.

      What is it what I see wrong?

      Cor


      Comment

      • Road Warrior

        #18
        Re: Modular Programming...

        well your syntax really sux for one.


        "Cor" <non@non.com> wrote in message
        news:uJF7qHmmDH A.2964@tk2msftn gp13.phx.gbl...[color=blue]
        > Hi Jay B,
        >
        > Lets start with, we totaly agree. But I have a question. I am of course[/color]
        from[color=blue]
        > an old fashion time.
        >
        > What I have always thought was that modulair programming was to divide[/color]
        your[color=blue]
        > project in managable structures, with reusable code in all parts of your
        > project.
        >
        > The best way to do that is in my eyes is using OOP techniques.
        >
        > When I reads this kinds of threads I always think. Modulair programming is
        > translated as using old fashion VB modules, which have in my eyes nothing[/color]
        to[color=blue]
        > do with modulair programming.
        >
        > What is it what I see wrong?
        >
        > Cor
        >
        >[/color]


        Comment

        • Jay B. Harlow [MVP - Outlook]

          #19
          Re: Modular Programming...

          Cor,
          Its one of those things that it is both. :-)

          The way I view it is, in the simplest sense Modular program is breaking your
          problem into individual modules. This can be applied to almost all
          programming languages, including languages that do not support Object
          Oriented Programming. For example on the AS400 (iSeries) I can apply modular
          programming to an RPG or COBOL program, by breaking my RPG or COBOL program
          in to manageable modules.

          OOP definitely encompasses modular programming as you group (divide) your
          project into manageable structures or classes...

          Hope this helps
          Jay

          "Cor" <non@non.com> wrote in message
          news:uJF7qHmmDH A.2964@tk2msftn gp13.phx.gbl...[color=blue]
          > Hi Jay B,
          >
          > Lets start with, we totaly agree. But I have a question. I am of course[/color]
          from[color=blue]
          > an old fashion time.
          >
          > What I have always thought was that modulair programming was to divide[/color]
          your[color=blue]
          > project in managable structures, with reusable code in all parts of your
          > project.
          >
          > The best way to do that is in my eyes is using OOP techniques.
          >
          > When I reads this kinds of threads I always think. Modulair programming is
          > translated as using old fashion VB modules, which have in my eyes nothing[/color]
          to[color=blue]
          > do with modulair programming.
          >
          > What is it what I see wrong?
          >
          > Cor
          >
          >[/color]


          Comment

          • Tom Leylan

            #20
            Re: Modular Programming...

            "Cor" <non@non.com> wrote...
            [color=blue]
            > When I reads this kinds of threads I always think. Modulair programming is
            > translated as using old fashion VB modules, which have in my eyes nothing[/color]
            to[color=blue]
            > do with modulair programming.
            >
            > What is it what I see wrong?[/color]

            I'll jump in and suggest you have it correct. People seem to be mistaking
            "modules" with modular programming. Writing modularly is a logical
            consideration which promotes code re-use while reducing maintenance
            headaches. Modules are physical things and are little more than a storage
            mechanism.

            It is quite possible to write a "modular" program in a single physical
            program file or to write a completely non-modular program which is stored in
            a dozen or two module files. I wrote a short article named "Function
            Reusability and Contracts" which attempted to illustrate the idea... it
            ended with "remember, a dumb function is a smart function."

            Meaning of course that anything it needs to know is passed in and any
            results are passed back. It isn't typically considered modular if the
            routine relies on some public variables being present and it isn't
            considered modular if the function you devise to calculate the cubed root
            automatically displays the result in a textbox.



            Comment

            • I_AM_DON_AND_YOU?

              #21
              Re: Modular Programming...

              Can we read your article?


              Comment

              • Cor

                #22
                Re: Modular Programming...

                Jay B,
                Thanks for your answer
                I think we agree even more now.
                Cor


                Comment

                • Cor

                  #23
                  Re: Modular Programming...

                  Tom,
                  Thanks for your answer, gives me more courage to tackle some arguing.
                  Cor


                  Comment

                  • Tom Leylan

                    #24
                    Re: Modular Programming...

                    "I_AM_DON_AND_Y OU?" <user@domain.co m> wrote...[color=blue]
                    > Can we read your article?[/color]

                    There are a few of them on-line, choose the "Clipper" link at:


                    They were written about a DOS-based compiler but I think you will find that
                    they are generic enough to be of value in a Windows world. Personally I was
                    really happy with "Look Towards the Past" which dredged up old programming
                    samples and applied them to the present.


                    Comment

                    • I_AM_DON_AND_YOU?

                      #25
                      Re: Modular Programming...

                      Thanks.

                      "Tom Leylan" <gee@iamtiredof spam.com> wrote in message
                      news:%vgmb.3751 3$pT1.20566@twi ster.nyc.rr.com ...[color=blue]
                      > "I_AM_DON_AND_Y OU?" <user@domain.co m> wrote...[color=green]
                      > > Can we read your article?[/color]
                      >
                      > There are a few of them on-line, choose the "Clipper" link at:
                      > http://www.leylan.com
                      >
                      > They were written about a DOS-based compiler but I think you will find[/color]
                      that[color=blue]
                      > they are generic enough to be of value in a Windows world. Personally I[/color]
                      was[color=blue]
                      > really happy with "Look Towards the Past" which dredged up old programming
                      > samples and applied them to the present.
                      >
                      >[/color]


                      Comment

                      • Fergus Cooney

                        #26
                        Re: Modular Programming...

                        Hi Jesse,

                        You deserved a ROFL with a couple of pots in a different context. Those
                        were OT and OTT threads in which any old rubbish was 'appropriate'.

                        Here in the useful stream, a comment like that is of no use to anyone.

                        Regards,
                        Fergus


                        Comment

                        • Fergus Cooney

                          #27
                          Re: Modular Programming...

                          Hi Don,

                          If you would like - don't laugh - to send me a zip - sorry, ROFL - of
                          your Form, ROFL.

                          Let's start again.

                          If you send me a zip of your Form then I will be quite happy to show you
                          how to apply the ideas that have been put forward here. I have no objection to
                          the zip being attached here but it might be appropriate, at this time, to send
                          it to me by email. I'll only need the source files - Form and .resx. No obj or
                          bin directories this time, eh? ;-)

                          Regards,
                          Fergus

                          ps. In case you missed it in the other thread. Button1.Context Menu = Nothing
                          worked fine when I tried it.


                          Comment

                          Working...