* Floor Terra <flo...@gmail.com> [2009-12-19 19:10]: > On Sat, Dec 19, 2009 at 6:08 PM, Henning Brauer <lists-open...@bsws.de> wrote: > > * Floor Terra <flo...@gmail.com> [2009-12-19 16:47]: > >> But in my experience copy/paste of code in any language is dangerous. > > > > [ ] you have ever seriously used C > > > > heck, even perl. > > > > In my experience (mostly python and c), code that has been pasted has > a higher bug density. > > This is because most of the copy/paste goes like this: > 1) Write some loop > 2) Need similar loop > 3) copy/paste old loop > 4) Modify pasted loop (but forget one tiny change) > 5) New loop has bug > > It's worse with Python because of the indentation (tabs vs. spaces), > but as a general rule I would say never copy/paste code.
boo hoo. there are very valid uses of copied code, or extremely similiar code (copy & paste and change a few things). we have that many times in the tree. the enforced indentation is completely nuts. i purposefully indent extremely incorrectly when adding debug code that i intend to remove again, to spot it faster. just one example, there are many more. python doesn't solve a problem. perl's been there already. oh, and the 80s sed, i use it a lot. as well as shell scripts. -- Henning Brauer, h...@bsws.de, henn...@openbsd.org BS Web Services, http://bsws.de Full-Service ISP - Secure Hosting, Mail and DNS Services Dedicated Servers, Rootservers, Application Hosting