Hacker News new | ask | show | jobs
by fred_durst 4406 days ago
I've been programming for maybe too long now, but likely not nearly as long as the higher level advanced developers, but still the idea that people copy & paste code from Google/SO is horrifying. You are really just going to work on some real life project and just blindly copy some random crap you found online without even knowing what it does completely? Yikes.
4 comments

I find it amazing how often I see comments on Stack Overflow complaining that the obvious pseudocode solution (meant as a guideline to explain the correct answer) "doesn't work". It seems like it's very common to outright copy and paste code without any sort of basic critical thinking on how to properly integrate it into one's project...
Uhm, that's how I still learn new languages. Copy, paste, modify just to get something done.

The modify part leads to more concrete questions, more Googling, more detailed reading of docs, until at some point I'm engaged enough to go back to zero and actually start learning the language from the basics.

(This doesn't work for those languages who's paradigm you first need to understand before being able to do anything, but most languages allow for hacking straightforward procedural code at the basic level.)

I mean this in the best way possible, but do you like actually take your mouse over to the webpage, highlight the code, copy it, and then paste it into your editor? I am genuinely curious.
Yes. I do this from time to time. Recent example, wasn't sure what the event was called in JavaScript when the window changed. Couldn't remember if it was resize or windowResize or whatever.

SE had a sample dummy event listener add function, complete with // do stuff here. I cut and paste the whole thing and added what I needed.

I suppose I could've retyped the addEventListener function from scratch but...I dunno, that seemed inefficient. I just needed the name.

If you don't know what a thing does and you don't have the time to learn it, sure. A few years ago when I was making my first applications I "used" regex's off of stack overflow long before I was able to take the time to learn the syntax myself. At the time it was much more important for me to learn design and compilation than it was to go off and learn regex.
It's so common, large companies have entire teams dedicated to running Black Duck scans of their software to hunt down the paste-ins lest their software become open source or their patents cross-licensed by accident.

That scenario might not be entirely possible given the terms of GPL and Apache, but that's how they talk about it.

The problem such companies has is extremely similar to news papers. They constantly has journalists that copies from Wikipedia, uses images from "the Internet", and end up committing copyright infringement, for profit, in a commercial scale.

Even political parties who's slogan is more police and harsher punishment don't understand copyright. In Sweden, the extreme right just plucked some images from the internet, did not check the license, and used it in their party program and commercials. In the end, every Swedish household got sent a pirate copy.

The problem is that copyright infringement is so extremely easy to do, that it happens everywhere, and will likely keep happening regardless of scans.