Forgot your password?
typodupeerror
Programming IT Technology

How Mainstream Can Code Scavenging Go? 139

Posted by ScuttleMonkey
from the unwanted-easter-eggs dept.
The time-honored tradition of code scavanging has long been a way for new programmers to "break in" to a new language or task that they may not want to build from the ground up. The re-use of old code, cleaned up and tweaked to a new purpose can help developers learn many useful skills and accomplish tasks quickly, especially for small tasks that aren't of vital importance. One blogger wondered if this process could be formalized and tools could be built to help foster and enable code scavanging on a mass level. Is this a viable option, or are there just too many things to consider?
This discussion has been archived. No new comments can be posted.

How Mainstream Can Code Scavenging Go?

Comments Filter:
  • IP Laws? (Score:4, Interesting)

    by gambit3 (463693) on Saturday December 01, 2007 @01:18AM (#21541585) Homepage Journal
    So, how quickly would you run afoul of Intellectual Property laws doing this?
    • Re: (Score:3, Funny)

      I want to be the first to welcome our new GPL overlord to the commercial software world.
    • Re:IP Laws? (Score:5, Insightful)

      by caffeinemessiah (918089) on Saturday December 01, 2007 @01:24AM (#21541613) Journal

      So, how quickly would you run afoul of Intellectual Property laws doing this?

      That's a great knee-jerk reaction. Without understanding the motivation behind the article, you assume that code scavenging means stealing other people's code. What they're really talking about is (legitimately) re-visiting code that you or other people have written, and then picking and modularizing bite-sized chunks. In other words, you would design a large program (mark I) and then go back and pick out useful parts, clean/debug them and have working modules (mark II) for the next project.

      Also, for people who haven't read TFA, it's 9 short paragraphs long and barely an article. They talk about a "formal approach to code scavenging" without even coming close to explaining what exactly that MEANS.

      • You write program A ... eventually you refactor it and turn parts of it into cleaner modules.

        You can then use those modules in other programs.
      • Re:IP Laws? (Score:5, Interesting)

        by sootman (158191) on Saturday December 01, 2007 @01:56AM (#21541785) Homepage Journal
        They talk about a "formal approach to code scavenging" without even coming close to explaining what exactly that MEANS.

        Agreed. Reading TFS, I thought it was going to be yet another "we can make programming like Lego!" thing. (Which it ain't, and probably never will be. [joelonsoftware.com] Bonus reference: "Lego" is mentioned in the second paragraph of this article [wired.com] about Steve Jobs/NeXT/WebObjects from Wired. God bless Wired and their eternally fucked-up CMS that can't serve images for any story in the archive and, this week, shows the actual HTML code that should be formatting the Question-and-Answer portion of the article.)

        Reading TFA, I really don't know much more than I did before. This is the best I could come up with:

        Code scavenging is seen as the most frequent and least complex way of re-using code and has been common practice at an informal level since programming first began. Programming is difficult to teach and most programmers learn their chops by looking at working code and using it as the basis for building their own programs. In other words, they "scavenge" the good bits and tweak them to a new purpose.

        The term scavenging appears to have first surfaced as a formal concept in a 1992 paper by Charles Krueger of Carnegie Mellon University. It was tested by academics in the 1990s but rejected because it yielded few gains for a lot of effort.

        According to Hackett, code scavenging is worth re-visiting because the Web makes it easier to find code and re-use it. He points to sites where massive amounts of existing code are available for potential scavenging such as Google code search, Sourceforge, Code Project, Microsoft's Codeplex, and O'Reilly's Code Search. Others include the Free Software Foundation (FSF), FreeVBcode.com, Freecountry and Freshmeat.

        So, code scavenging is... um, re-use? Can anyone make better sense of that than I can?

        "In other words, they 'scavenge' the good bits and tweak them to a new purpose."

        Um, no. You scavenge the pieces you need, not necessarily the good bits. Have you ever been looking for some code to do parse phone numbers, and while looking at source, said "Hey! This looks like a great way to compare two lists!" Probably not. You're only looking for formatting code, so that's all you see, so that's all you get. Looking at source is not like looking at produce at the food store, where you can walk by the tomatoes and they catch your eye because they're perfectly ripe and really, really nice-looking.

        Rather than searching Google, I think every good programmer should take the time to create a really good library. I don't mean take the time writing great code, I mean take the time to organize it into a proper library: make one, clean, well-commented version; put things into variables, ($tableName in queries instead of the actual table name, etc.) and pull code from that when you need it, rather than just copying-and-pasting from the last place you remember using it and then changing all the variable names, table names, etc.

        I plan to make mine Real Soon Now. :-)

        >> So, how quickly would you run afoul of Intellectual Property laws doing this?

        > That's a great knee-jerk reaction.


        No, that's just the first thing that popped into his head. (Pardon me if I'm putting words in your mouth, Mr. Gambit.) With that one sentence, he did not say (or imply) "The only people who would use this are thieves." He just put out that question for people to discuss. That topic came up here just a couple days ago. [slashdot.org] I highly recommend reading that discussion. There are some very good points; among them, that if you publish something with no licensing info, it is copyrighted to you by default. (In the US at least,

        • by tuomoks (246421)
          A good comment! And the IP part is important, you just can't take any code you see, you can read it and code the solution yourself in most cases but there are some darn patent issues - stupid laws patenting algorithms !
          Another good point in comment "every good programmer should take the time to create a really good library" And this should go without saying, build your own library of templates and snippets you carry as long as you do coding, often saves a lot of time. Some companies which use SM/CM ( source
        • Re: (Score:3, Insightful)

          by alex4u2nv (869827)

          These are the ideas that CPAN, PEAR and other code repositories are built on. So instead of trying to reinvent the idea, the author should have poked around a little more, and to learn more about what is available as opposed to trying formalize a "hackup job."

          The parent makes a good point here, where you should take the time to build a clean library base to work with. If one should have a well structured infrastructure, and should they need to implement a certain feature, more often is the case, that a g

        • Re: (Score:3, Funny)

          by jc42 (318812)
          [I]f you publish something with no licensing info, it is copyrighted to you by default. (In the US at least, and many other countries as well.) So even if you're looking at a site that is, say, clearly marked as a tutorial, that doesn't necessarily mean that you can use that code, unless the guy comes out and says the code is public domain/GPL/etc.

          Good point. I think I'll use it the next time someone comments about code of mine that is overly complex and convoluted.

          "You see, all the simple ways of doing it
      • I think that in some rare cases, code scavenging is helpful. However, in most cases, it does not lead to solidly engineered software. Basically you get a piece of code, review your code, analyze the interface, prefactor, debug, postfactor, and now it is working well. By that time, you could have written a rough draft, debugged, and postfactored in less time and gotten a more consistent codebase out of it.

        So I am not sure at all to what extent this code scavenging is sufficiently helpful to make formalize
      • What they're really talking about is (legitimately) re-visiting code that you or other people have written, and then picking and modularizing bite-sized chunks. In other words, you would design a large program (mark I) and then go back and pick out useful parts, clean/debug them and have working modules (mark II) for the next project.

        Exactly! You can visualize these modular chunks of code as actual objects actually. Each object could have a series of methods that you could manipulate to make it do thing
      • by CptPicard (680154)

        They talk about a "formal approach to code scavenging" without even coming close to explaining what exactly that MEANS.

        It's just another made-up specialization field for software engineering academics who didn't quite cut it in the real compsci stuff... even they need to write their papers on something.

    • in the case of visual basic for example, Microsoft made almost all the functions and objects used so you can't do some little code snippet using them and say somehow now you own it. That's like a company making cars and they sell one to you and you patent demolition derbies because you discovered a new thing to do with their tools. Now big, long programs or large, specialized modules that would have the same structure in any language and actually represent some logical idea that someone created are a diff
      • by cromar (1103585)
        Dude... your example of derby demolition is a really good one. That appeals to a lot of people because everyone knows what it is. (A good car analogy on Slashdot?!!) WWE! :) (And I honestly mean that with all sincerity!)

        P.S. MSDN docs do often suck... luckily their IDE and Google results are OK.

        P.P.S. A fi bun mi sensi.
    • by RobBebop (947356)

      Some code cannot be copyrighted. HTML, for instance, cannot be locked away and hidden in a vault because it relies on being there so the browser can render it at the time of the download. Those, HTML is a great "scavenger" language, because it is easy to learn new techniques by poking around the "View Source" code.

      Other code that cannot be copyrighted is copylefted. The GPL expressly guarantees that code can be used, studied, modified, and redistributed.

      Now... formalizing a lesson plan to teach stude

      • by Dogtanian (588974)

        Some code cannot be copyrighted. HTML, for instance, cannot be locked away and hidden in a vault because it relies on being there so the browser can render it at the time of the download.
        Just because you can easily view it doesn't mean that it's not copyrighted. What on earth made you think otherwise?!

        Realistically, of course, there's the question of how far you can copyright many (small) HTML fragments and techniques anyway, but that's not the point you were making.
      • by CRCulver (715279)

        HTML, for instance, cannot be locked away and hidden in a vault because it relies on being there so the browser can render it at the time of the download.

        CSS style sheets also downloaded for the browser to render, and yet some of the best CSS designs out there are copyright.

    • by cromar (1103585)
      I, for one, .... always check the licence of snippets I use :)
    • by mollymoo (202721)

      So, how quickly would you run afoul of Intellectual Property laws doing this?

      You're highly unlikely to run afoul of trademark laws and absolutely guaranteed to run afoul of patent law in the US, or virtually guaranteed not run afoul of patent law elsewhere. So you must have meant copyright. Why didn't you just say copyright? Lumping copyrights, patents and trademarks together is futile for most purposes and calling them "property" is dangerously misleading.

  • by kclittle (625128) on Saturday December 01, 2007 @01:23AM (#21541607)
    ...since they obviously aren't going to be using it for much longer...
    • SCO recently announced a 3 trillion dollar law suit against the owner of the kclittle slashdot ID. When asked about the dollar amount, they said that the "three billion" number lost its glamor and is no longer taken seriously.
  • Vernor Vinge (Score:5, Interesting)

    by boster (124383) on Saturday December 01, 2007 @01:25AM (#21541615)
    In A Deepness in the Sky, Vernor Vinge posited Programmer Archaeologists would replace all new development. http://everything2.com/index.pl?node_id=760521 [everything2.com]
    • Not like it took deep thought to arrive at that conclusion - a look at the nearest sysadmin (myself just as guilty) and the wee habit of script-scavenging is sufficient to serve as a parallel.

      /P

    • Re:Vernor Vinge (Score:5, Insightful)

      by bcharr2 (1046322) on Saturday December 01, 2007 @03:41AM (#21542189)
      Code is basically an algorithm that solves a computational problem. So yes, you can cut and paste algorithms. If you want your application to be maintainable, however, you also have to solve the larger architectural problems, which is something you DON'T get when you cut and paste code.

      It is one of the most misunderstood concepts about programming. A programmer fresh out of college knows how to write algorithms really well, but has no idea that there are architectural and design land mines waiting for them just down the development road.

      Too many development shops will get an app "working" and think that is all there is to development, because no one has the depth of experience to look a year down the road and see that they will need to rewrite the entire app from scratch in order to make the simplest of changes.

      I'm sorry, but if your program is not extensible nor maintainable then you really haven't "succeeded" at anything. You've simply fooled yourself into thinking the process is simpler than it is while screwing your clients out of their development dollars.

      • by mochan_s (536939)

        It is one of the most misunderstood concepts about programming. A programmer fresh out of college knows how to write algorithms really well, but has no idea that there are architectural and design land mines waiting for them just down the development road.

        I think you're wrong here.

        In college, a lot of architectural designs have to be made and made quick. OK, they are for small projects but still those designs have to be made. Plus, you have the luxury of seeing what other people designed and how it work

        • Re: (Score:3, Insightful)

          by Alphager (957739)

          The method of assigning homework is to give 3 lines on what a program needs to do. For example, write an FTP client that you can use to download a file. The method of grading is if you can download a file or not. The decision on how to get the HW done with the least amount of time spent is an architectural challenge.

          Which is what the parent hates: people who only think about getting the product out of the door and who sacrifice things like maintainability.

          Even firefox and Mozilla did a few complete rewrites of the various parts. Rewrites are part of programming unfortunately. The nice thing about rewrites is that the programmers now have experience on how to do things better and are able to better compartmentalize the code. I wouldn't say rewrites are terrible things - though they do annoy management and people above to no end.

          Firefox & Mozilla are prime examples of bad codebases. We all know the disaster that was the last rewrite in-house at Netscape.
          _SOME_ re-writes are necesary and usefull, but a company where the usual way to add a new feature is a re-write of the whole software is doing somethign wrong.

      • ``You've simply fooled yourself into thinking the process is simpler than it is while screwing your customers out of their development dollars.''

        Which, of course, makes good business sense. At least until customers start selecting on maintenance/improvement cost instead of initial development quote.
    • In A Deepness in the Sky, Vernor Vinge posited Programmer Archaeologists would replace all new development. http://everything2.com/index.pl?node_id=760521 [everything2.com]

      Thanks, I already know Python.
  • code repositories (Score:3, Informative)

    by drfrog (145882) on Saturday December 01, 2007 @01:29AM (#21541639) Homepage
    like cpan and ruby gems etc

    we scavenge code online w/e, find it needs to be used by a lot of people

    so we inherit the scavenged and put it in a nice module and tada!

    this is nothing new

  • semi-formalized (Score:5, Informative)

    by mycall (802802) on Saturday December 01, 2007 @01:35AM (#21541675)
    Some people are already doing this, such as koders [koders.com], code fetch [codefetch.com], codase [codase.com], and snippets [dzone.com]. Talk to them for formalizing as I'm sure they have some good input.
  • by Animats (122034) on Saturday December 01, 2007 @01:35AM (#21541677) Homepage

    The Web 2.0 crowd rediscovers subroutine libraries. Film at 11.

    • by calebt3 (1098475)
      I don't even know how too code and I was thinking "library".
      And to preempt those that like to pun: I mean the "DLL" kind. Not the "lots-o-books" kind.
      • Re: (Score:3, Funny)

        by visualight (468005)
        The poster you replied to is thinking the "lots-o-books" kind (I'm sure). As in, "a library of subroutines".
    • Re: (Score:1, Insightful)

      by Anonymous Coward
      Seriously though: welcome to CPAN.
    • Re: (Score:3, Funny)

      by Tablizer (95088)
      The Web 2.0 crowd rediscovers subroutine libraries. Film at 11.

      You gotta punch it up, PHB-ify it: "Reusable Enabling Action-Oriented Web Object Architecture Patterns".
         
    • Re: (Score:3, Funny)

      by Comatose51 (687974)
      You joke but I've phone interviewed someone and asked him, "What are some ways of reusing code or implementation?" Inheritance or composition would have been okay. In fact, a lot of answers are acceptable.

      Instead, he answered "uh... cut and paste?"

      • by joss (1346)
        I don't think of inheritance and composition as *reusing* code,
        thats more just *using* it afaiac so I guess I would have been
        stumped by that question too. Lisp can double as knitting patterns
        and I guess perl can be a decent approximation to line noise, python
        can sometimes be read as intensely obscure haikus but its all a bit
        of a stretch.
      • by rah1420 (234198)
        I would have hired him. These young whippersnapper programmers thinking that they are all that. What's wrong with 3GLs anyway?

        At the end of the day, it's all ones and zeros.
  • Google Code (Score:3, Informative)

    by TooMuchToDo (882796) on Saturday December 01, 2007 @01:40AM (#21541689)
  • by Yath (6378) on Saturday December 01, 2007 @01:41AM (#21541701) Journal
    I guess this is slow news day. Using bits of code without writing everything from scratch - how novel! How controversial! Is there anyone who doesn't do this? What kind of skull-shattering boredom do you have to endure before you start writing blog entries about this?

    And the first article suggests that trusting the code is an issue, because you didn't write it. Well let's see - it's short, and you just pasted it into your program. But you're not going to bother to read it? You fail. Seriously.
    • by jgrahn (181062)

      I guess this is slow news day. Using bits of code without writing everything from scratch - how novel! How controversial! Is there anyone who doesn't do this? What kind of skull-shattering boredom do you have to endure before you start writing blog entries about this?

      It might be a new idea for more people than you think. There is this ideal picture of people writing The Perfect Software from scratch, isolated from the rest of the world. And there is the other ideal, people assembling The Perfect Software

      • by Splab (574204)
        Is it really?

        Don't know about you, but I don't have the legal background to figure out what happens to licenses for the code when you copy and paste others code into your project.
    • by GunFodder (208805)
      You said it. I think they have a name for reusing existing code, it's called "Software Engineering."
  • by poppycock (231161) on Saturday December 01, 2007 @01:42AM (#21541721)
    Isn't this, you know, a library?
  • by Anonymous Coward
    Why don't you scavenge the dictionary to spell properly?
  • Unlikely? (Score:4, Interesting)

    by SnoopJeDi (859765) <snoopjedi@ g m a i l . c om> on Saturday December 01, 2007 @01:47AM (#21541747)
    From TFA:

    You are unlikely to find what you want with a simple Web search


    Since..when? Recently I've picked up perl again, and I've found more than what I need to scavenge to make my own personal extensions to blosxom [blosxom.com] through google searches.

    I mean, granted, it depends on your definition of a bite-size task, but it's a blanket statement no matter which way you spin it.
  • Isn't that basically the point of a linkable library?
  • by AEton (654737) on Saturday December 01, 2007 @02:02AM (#21541813)
    If only there were some computer programming language that had built-in support for some kind of a Comprehensive Archive Network, that would be the best.

    Maybe the C++ language could do it. Then you could just ... hmm ... "import" the things you need from the Comprehensive C++ Archive Network!

    Hmm, CC++AN sounds pretty dumb. It'd never catch on. Oh well.
    • Hmm, CC++AN sounds pretty dumb. It'd never catch on. Oh well.

      Oh, c'mon! It has one potential use - It sounds like a munged pr0n version of something for Perl [cpan.org]. That alone would make the effort worth it, no?

      /P

  • by xxxJonBoyxxx (565205) on Saturday December 01, 2007 @02:06AM (#21541831)
    Today Slashdot jumped the shark.

    Seriously. I'm starting to lose brain cells when I read the "articles" these days.
  • It's called Google.
    • And CPAN [cpan.org].

      (and half a bazillion other projects... Hell, not it's been going on before Microsoft decided they needed a working TCP/IP stack for Windows 2000 or anything...)

      /P

  • by Anonymous Coward
    What a great new idea! Maybe we could put all of the scavenged code into a container and call it a "library". Wiyth brilliant ideas like this software is going to advance by great leaps and bounds. No more reinventing the wheel, or constantly rediscovering ancient ideas.

  • Wow (Score:5, Funny)

    by smitth1276 (832902) on Saturday December 01, 2007 @02:50AM (#21542007)
    That article used a lot of words to say absolutely nothing. But it got me thinking... perhaps we could group related snippets of code into units called "libraries", and then we could easily use those libraries to perform common tasks?
  • It's a funny game, using plucked code. I do agree that when it comes to learning a new language, or learning to program for the first-ish time, nothing's better than stitching together mounds of existing code and watching things emerge.

    When it comes to real business requirements, things are a little milky. I own and operate a small business, and there are a few problems with plucking code from the ether. The first is the notion of hiring a programmer to not write their own code. Getting the job done, an
    • by einhverfr (238914)

      A while back, I asked one of my programmers to write a routine to dump out a Perl structure. I said I needed it in about a week. Lo and behold, it worked on-time and all was good.

      What is wrong with Data::Dumper? Or rather did you need something that worked with Data::Dumper?

      Turns out, as any Perl expert here knows, my programmer simply took the Dump module, which dumps perl structures. I wanted to have the dump be a nice dynamic javascript html table thing, and my programmer told me no -- or rather that it would require him to do it from scratch, and of course now, a month later, we didn't have the time.

      Having done a lot of work with Perl, I would say that Data::Dumper is the wrong thing to use for that. TemplateToolkit, OTOH, would allow you to quite quickly generate HTML based on your data structure. A competent Perl programmer shouldn't require too much time to do that, esp. if it is in a different document.

    • Ultimately, my point is that when you control every line of code, you aren't hampered by other people's restrictions. I would have been happy had my programmer written his own dumping code from scratch, but I also would have been happy had he started with the cpan dump code, searned from it, and created a derivative version. Hell, in this case, I'd have been happy if he had studied it to the point where he could have modified it easily.

      Sadly here is where you are terribly wrong. They key to doing what you want to do is to understand what you want from the beginning, do the requirements analysis up front, etc. and so forth. There is a *huge* difference between dumping a Perl object (the way Data::Dumper does) and creating a nice HTML document from it.

      Your programmer, if he was smart, grabbed the CPAN module, wrote a little wrapper around it, and integrated it into your application. If you had known what you wanted up front, he would ha

  • #include

    using namespace std;

    int main()
    {
              cout "Hello World!";

              return 0;
    }
    • oops (Score:2, Funny)

      by yoprst (944706)
      Apparently, slashdot has already scavenged angle brackets - they're gone. Truly the most scavenged code ever.
  • Microsoft Popfly? (Score:2, Informative)

    by im_thatoneguy (819432)
    Isn't that what microsoft is trying to do with PopFly?

    http://www.popfly.ms/Overview/ [popfly.ms]
  • How mainstream are SAE bolts? How mainstream is 18 gage 304 stainless sheetmetal? How mainstream is a CR2016 battery?

    Standardized and well-understood components save a vast amount of effort in other engineering fields and help produce results that are more easily verified to be good.

    Why not apply the same approach to software engineering? Isn't that the greatest promise of open source?
    • by einhverfr (238914)
      That is basically what libraries are, right?

      That is very different than taking a bunch of code, stitching it together, and building a system out of it.
      • by grumbel (592662)
        ### That is basically what libraries are, right?

        Not really, libraries are an implementation, not a ISO/ANSI/DIN/whatever standard, so their behavior is defined for most part by implementation, not by specification. So you don't find an independent implementation of GTK or QT or most other stuff, aside from a few libraries that clones other libraries (i.e. lesstif vs motif, Wine, etc.), but even there its not following a defined standard but just cloning things as best as you can.

        The only part of programming
        • by einhverfr (238914)

          Not really, libraries are an implementation, not a ISO/ANSI/DIN/whatever standard, so their behavior is defined for most part by implementation, not by specification. So you don't find an independent implementation of GTK or QT or most other stuff, aside from a few libraries that clones other libraries (i.e. lesstif vs motif, Wine, etc.), but even there its not following a defined standard but just cloning things as best as you can.

          Some libraries are indeed standardized (standard libraries for C for example). I guess the question is why one would want every library to be standardized. There is, however, a standard *process* for determining what people should put into libraries: Analyze the code, identify reusable routines, and put them in libraries.

          I think that is a huge problem, not only are the standard libraries to small, but they are often also terrible buggy and outdated, i.e. string handling in C is a total garbage, you have function like gets() which will cause buffer/heap overflows no matter what you do, you can't use that function correctly. And the alternatives like fgets() and such are cumbersome to use so that everybody ends up building its own little string library. I think in a day and age where security updates are installed on a weekly basis it would really help a lot to extend the standards a little more often instead of just every ten years, so that often used parts are more easily available and don't have to be reinvented each and every time. This would also help a lot in making libraries more compatible to each other, since you wouldn't need to convert forward and backward between types that are basically identical in their design.

          Ok, that is a fair statement gets() really should be removed and replaced by something with a max size argument.

          However, since standards bodies move at a glacial rate, why not create a

  • The title of this article seems to have been 'code scavenged' ... it makes no sense and wasn't proof read. 'How far can can code scavenging go in the mainstream?' perhaps
  • So... the formalised use of old code... you mean like CPAN [cpan.org]?

  • One of the selling points of object oriented coding was it was supposed to formalize this and make it easier. In theory all objects were to be designed to be generic and reused from day one. In practice it rarely works that way. Especially under tight dead lines and lean development teams.

    • by grumbel (592662)
      I don't think this has all that much to do with deadlines and more with objects being just as inflexible as what we did before them, i.e. as soon as an object wants to do anything useful beside very basic stuff it has to interface with some other object and unless you happen to have an object that has that interface you are dead in the water.

      Where objects help is in keeping related code together, but that is more syntactic sugar for stuff you would expect in a clean program anyway.
  • by James Youngman (3732) <jay @ g n u.org> on Saturday December 01, 2007 @08:04AM (#21543061) Homepage
    ... of an SF book I read a few years ago, where all programs were written by a process of digging into 10,000 years' worth of computer programs in a sort of archaeological way, pulling out something that did more or less what you want and amalgamating it with what you had so far. I thought at first that it was a Vernor Vinge [wikipedia.org] book, but checking the plot summaries on wikipedia, it looks like it was somebody else. Can anybody remember the book I'm thinking of?

  • int Tree( Char ***Node1, char **data)
    Sort a-z
    return height

    int retreive (char **return, char **searchfor, int length)
    return found

    For simple functions it works well, for open source code it works great.

    Between those levels lies the question, why aren't you using their code anyway?
  • Like most problems, textual code reuse has via copy & paste has already been studied, and a language based on first-class copy & paste is being developed [subtextual.org]; it's called the Subtext [subtextual.org] language. See a more detailed discussion of it on lambda-the-ultimate [lambda-the-ultimate.org]. Academia is not so far remove from everyday programming as people seem to think!
  • ... can one re-use the:

    int main( argc, argv )
    int argc;
    char **argv;
    {
    ...
    }

    code snippet?

  • Sark.... all my functions are now yours.... take 'em.

Live within your income, even if you have to borrow to do so. -- Josh Billings

Working...