Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's a pretty pessimistic view of code copying. There's real-world experience for you.

I don't know why there'd inherently be bugs in a decently simple chunk of code. There's often bugs, especially if the language or API is unwieldy and getting in the way of expressing the aim. Look at how easy it is to write an incorrect binary search of an array. Then there's common "off by one" or "fence post" errors. And people copy one line to a line below but only change one of the two things that need changing.

And we're not talking about a huge system, so whether you catch bug fixes is irrelevant. Paul's estimating 100 lines. You don't want to have to be detecting bugs, let alone fixing them, in someone elses code of that size if the well-tested, not grabbed off the Internet, library provides a routine to do it for you. If there's a bug in PIL then everyone will get the fix on the next release, not so for a copy-and-paste code.

Code copying is pretty much a standard thing. Yes, there's much wrong with coding practices today.

I don't know why everyone's hating on it so much. We've seen the outcome. We've maintained systems where people were doing this twenty years ago and the problems it caused then are still being created today.

The Ruby on Rails community has pretty much built itself on code copying... Yes. 8-D



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: