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

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.


> 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.

I deeply disagree with this and for such obvious reasons.


Why? A widely accepted answer(many points) is most likely correct/best practice/bug-free.


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?


Old-school static linking works like that. Dynamic linking no, though I guess you could argue it's copied in memory at runtime.

But even if there's copying going on at the implementation level, it's an important conceptual distinction to make.


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.


Did you just call SO a junkyard?


If the shoe fits...


All I can say in response is I sincerely hope we never end up working together


Don't worry: we won't. You, me and the rest of us are going obsolete ;)


Why not? If it gets the job done (probably faster too). I would even suggest that be realistic and allow copy/paste during interviews too!


So that interviewers can gauge your ability on searching & referencing code examples from the web? Who's being realistic?


I've often told people that I'm just a good programmer, but a phenomenal Googler. Even in interviews.

Being able to search and separate the wheat from the chaff is most definitely a skill. Unless you always want to be reinventing wheels.


Yeah but when you found the wheat you still need to know how to make bread.


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.


When I hired people for a very entry level position, this was 100% on the list of things you had to be able to do (use google effectively.)

Its amazing how many people cant.


I think it forgets to include a license for all of the snippets that you use.


All StackOverflow "user contributions licensed under cc by-sa 3.0 with attribution required"





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

Search: