-
"Sometimes it's good that the same code be written more than once. You call it reinventing the wheel, but I call it perfecting the technique. :-)" --Shane Hathaway
http://mail.zope.org/pipermail/zope-coders/2002-December/002946.html
(Thanks to Zwiki.org's AnnoyingQuote for highlighting and bringing this one myway.)
-
One of the old timers in my office once said, "I haven't written a program from scratch in 15 years -- I just grab code from the programs others around here have written or stuff that I wrote once upon a time." What's different is that he's been coding for 25 years -- his pinky knows more about programming that I do.
That brings up the moral to this story -- You should never use code in your programs that you don't understand. Because you have put your name on it, you are now responsible for it, so if it breaks or needs to be changed, it's up to you, not where you stole it from. For more info, read what the Pragmatic Programmers says about Code Wizards (which is really the same thing as what we are talking about). http://www.pragmaticprogrammer.com/ppbook/extracts/wizards.html
For me -- I borrow from my old code all the time. I think that's the perfect way to do it -- I have all sorts of old programs that I've mucked with laying around and I freely use parts of it when working on something. But I'm always leery about borrowing code from others.
-
Mike, I think you're mixing up reuse in two different senses of the work:
Integrating your code with someone else's library/software, like pyAmazon, wget or WebSphere. (Hans)
Cutting and pasting actual lines of code (wizard-generated or otherwise) into an application you are writing. (PragProg)
And, in a third sense, you're always using someone else's code, on some level -- OS, compiler, etc.