Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Re: Advantages

This is a discussion on Re: Advantages within the Software Patterns forums, part of the Testing category; Andre wrote: > ... what advantages there are in using design patterns... do they > make code more complex? If ...

  1. #1
    panu Guest

    Re: Advantages

    Andre wrote:

    > ... what advantages there are in using design patterns... do they
    > make code more complex?



    If you know your patterns - and can identify them from your code -
    they actually make it less complex. Why? Because you can apply a
    pattern in several places, but you can *reuse your understanding* about
    it everywhere.

    Consider a carpet with a few repeating 'patterns' woven' into it. It is
    relatively easy to understand and describe such a carpet, as opposed to
    one where every thread is random.

    Consider a detective trying to solve a set of crimes. If there is a
    common 'pattern' in all of them, the case becomes considerably less
    complex, and easier to solve.

    Design Patterns is about reuse of well proven organizations/solutions
    within your code. Every time you reuse something, the total complexity
    decreases.

    -Panu Viljamaa




  2. #2
    Bill Burris Guest

    Re: Advantages


    "panu" <panu@fcc.net_zerospam> wrote in message
    news:0SOdnbzIPbHnPpiiXTWJiQ@fcc.net...
    > Andre wrote:
    >
    > > ... what advantages there are in using design patterns... do they
    > > make code more complex?

    >
    > Design Patterns is about reuse of well proven organizations/solutions
    > within your code. Every time you reuse something, the total complexity
    > decreases.
    >


    With Design Patterns you are also reusing the expertise of many other
    developers who have spent a lot of time thinking about these patterns.

    When a engineer sets out to build a bridge he doesn't sit under an apple
    tree waiting for an apple to fall on his head, so he can rediscover the laws
    of physics and engineering principles. Instead he learns the patterns
    discovered by physicist and other engineers.

    Your time is better spent learning patterns identified by others, then to
    re-discover those same patterns on your own. This way you are more likely
    to end up building skyscrapers instead of houses.

    Some people seem to think that using patterns turns your job into kids play,
    plugging together Lego blocks. This is far from the truth. What it does is
    bumps your productivity up so that you can move onto more interesting
    things, instead of spending your time debugging similar code over and over.

    You also want to learn unit testing and refactoring, so you can take any
    piece of crappy code written by someone else or yourself and clean it up.

    Bill





Latest Article

Network Security Risk Assessment and Measurement

Read More...