4 ms·
Copy/Paste as horrible I think is oversold. I would never paste in a snippet of code from a bad programmer because the code would look ugly and wrong and it wo
by encoderer 15y ago
Copy/Paste as horrible I think is oversold.
I would never paste in a snippet of code from a bad programmer because the code would look ugly and wrong and it would be obvious.
So the risk is bad programmers copy/pasting from other bad programmers. Sounds like an argument against bad programmers, not copy/paste.
Not everything should be abstracted into a library. I think the example in their screencast is a good one.
Yes, if the snippet has a bug, you're copying that bug everywhere. But if it doesn't, it saves you from writing a potentially buggy implementation.
I believed for many years as a programmer the dogma against copy/paste. Now i use it, as I use any other tool, in a way that I find appropriate.
- kragen 15y agoWhat do you think of the version of the code I posted at http://news.ycombinator.com/item?id=2904572 http://news.ycombinator.com/item?id=2904572? I originally wrote it in response to your comment, "Not everything should be abstracted into a library. I think the example in their screencast is a good one," but then I thought it might have wider interest.
- Groxx 15y agoBut what if the code looks beautiful and right, but hides a rare bug that the designer doesn't know about? I totally agree, it's over-sold. But any time you're using something you don't fully understand, you run risks. Being able to be informed of updates / problems would change the entire practice of re-using snippets, and integration into an IDE is the perfect way to do so. You, as a contributor, could even learn of problems / improvements that others have found.
- encoderer 15y ago"But what if the code looks beautiful and right, but hides a rare bug that the designer doesn't know about?" All I'm saying is, in my experience, developing systems and apps for 10 years, the "rare bug" you talk about is just not a big enough problem to warrant that kind of caution. Because the kind of code that you put in a snippet and reuse is the kind of "glue" or boilerplate code that is a solved problem.