Code Reuse


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Code Reuse

  1. #1
    Mark Newman Guest

    Code Reuse

    Hi Again,

    The mantra of code reuse and the claimed benefits have been around since the
    days of "structured design", yet study after study reveals that actual code
    reuse is quite low, 20% or so. Why do you think code reuse is so low?

    To me, it's because code reuse just doesn't work on a large scale. It works
    great on small, sharply-focused components, but the larger or more complex
    the object is, the harder it is to integrate, debug and test in the overall
    system, not to mention being more bug-prone. You end up adjusting the object
    to make it fit the new system and then Poof! the benefits of code reuse are
    gone.

    Granted, 20% reuse can be a significant help on some types of projects, but
    it's way short of the reuse nirvana that vendors and academics keep
    promising.

    Mark




    Share on Google+

  2. #2
    Tim Patrick Guest

    Re: Code Reuse


    I was just reading an article on Next Generation Windows Services (NGWS) last
    night, and the author said that NGWS would finally accomplish the promise
    of code reuse. I had to hold back a chuckle because I knew it wasn't true.

    The reason why code reuse does not happen is because programmers do not have
    a vested interest in producing code that is reusable. It is not that programmers
    are not forward-thinking. Rather, they have a problem to solve now, usually
    within a budget and a deadline, and planning out a component so that it can
    be used in the next ten or twenty projects is just not high on the list of
    priorities.

    Code reuse does exist, but it exists at the component tools level. All of
    the VBX's, OCX's, commercial DLL's, and other ActiveX controls that you buy
    from vendors are implementations of code reuse. You buy them once, and you
    use them in dozens of projects. The vendors of these components have an
    economic interest in providing useful reusable components. When I work on
    projects, I do not have that same interest.

    In a way, COM really did help to advance code reuse because it provided a
    standard way for developers of applications to easily integrate components
    made to solve a common problem. I am sure that NGWS will advance code reuse
    a little bit more, but we are talking about single-digit percentage points
    here.

    I once watched a promotional video that showed two programmers building an
    application, one on a NeXT workstation, and one on a SUN workstation. The
    video was produced by NeXT, and of course the NeXT programmer finished the
    project in one-millionth the time of the SUN programmer. Although they never
    used the expression "code reuse," they did talk about including pieces already
    available on the system (components?) in your program, such as a FAX server
    piece. Code reuse existed long before NGWS, long before COM, even long before
    VBX's. But I bet the percentage of code developed for a project and reused
    has not increased dramatically.

    I often reuse pieces of other projects in new projects, but it is generally
    at the source code level. I once wrote a great ActiveX control in VB5 that
    had all of the features I wanted. But when the Windows Common Controls supplied
    in VB6 included much of the same features, I modified my hosting program
    to use the Windows control instead of my own. I ended up reusing Microsoft's
    code instead of my own, but the application works just great, so the customer
    is satisfied.
    -----
    Tim Patrick
    tim@vbstyleguide.com

    Share on Google+

Similar Threads

  1. Speaking of strings...
    By Harlow in forum .NET
    Replies: 246
    Last Post: 10-26-2002, 12:30 AM
  2. Will VB.NET be more stable than VB6?
    By Jason in forum .NET
    Replies: 125
    Last Post: 10-05-2002, 04:34 PM
  3. .NET equals Efficiency
    By Kevin in forum .NET
    Replies: 150
    Last Post: 03-04-2002, 05:40 PM
  4. Replies: 3
    Last Post: 07-09-2001, 03:25 PM
  5. Another Language
    By Steven Bell in forum .NET
    Replies: 260
    Last Post: 06-01-2001, 04:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center