If it's a joke "Ahah", if not it's just depressing. SO is a valuable resource to confront and understand concepts. Let's not encourage this copy/paste culture
The OS/SDK/Browser/Protocol/Firmware which you used to type this comment is a compiled copy/paste of a zillion lines of code, of which you probably typed none.
If we encourage the DRY paradigm in the whole development cycle, copy/pasting a function is just a further reach of such paradigm. Now, if a programmer decides whether or not study and understand the pasted code has nothing to do with the quality of the final product.
Furthermore, IDEs by design encourage copy/pasting to speed development, most offer functionality to store code snippets. In that sense SO is like a web extension of IDEs.
It may be bug-free, but it may not be the correct solution for the specific problem the programmer was trying to solve. It may also not do what is expected under different circumstances.
It may be a hammer when you're looking for a screwdriver.
> If we encourage the DRY paradigm in the whole development cycle, copy/pasting a function is just a further reach of such paradigm.
No, it's the opposite. The whole point of DRY is you don't copy/paste, you put the thing in a common place and have references to it.
Many SO answers are good enough to be libraries. But they should be libraries, not snippets that are copied and pasted. Fortunately we're moving in that direction - our library infrastructure is becoming good enough that it's worth releasing even small pieces of code as reusable libraries, and people are.
I'm not sure how linking (as part of compiling) works. I thought how it worked was by copying the compliled thing from other files into the same executable. Is this not the case?
I disagree that they encourage copy and pasting, what they really encourage is auto completion of well structured code.
Even if you find yourself copy and pasting your -own- written code, you should question why you're having to do that.
Is what you're doing perhaps better abstracted to somewhere else? Be that in an abstract class, a helper class, or even in a separate library from which you can reuse it.
IDEs excel in understanding your code, which helps finding where you've stored something and allows auto-completing access to it, which is almost definitely their most important strength.
This is like the car mechanic who goes to the used-parts dealer (the junkyard) and grabs the first part with the same size screw holes as the broken part.
You're not expected to invent the recipe for bread though - you're allowed to talk to people and find the best recipe, and if it's acceptable quality then you use that.
EDIT: Unless your job is to invent a better bread recipe.
Being able to search and use online code examples is a key skill in software development. The web has become the collective knowledge base for all of us.