28 comments

[ 2.8 ms ] story [ 66.2 ms ] thread
There is substantial technical debt introduced by copy and pasting code. I've made a rule for myself: Never paste more than three lines of code at once. It forces me to understand the code I'm copying, and it keeps my work tidy.
The trick to copying and pasting is doing it when it won't be you paying back the debt.

Just like how the US economy works.

That, or if you really have to use more, have a standard comment to mark such occasions so you can come back later and understand/fix it.

  // voodoo magic from stackoverflow starts here (link: ...)
> so you can come back later and understand/fix it

But, of course, that's very unlikely to happen.

Sure it does. Right when you're writing/updating the documentation.
I think you would come back to it when you're having a critical issue impacting lots of users and to fix it, you finally need to understand that code.
Exactly, it means the same thing, never.
I maintain a rather large code base and have found several

    // FIXME
comments in random places, put there by people who no longer work here.
Even just retyping the exact code helps me quite a bit.
Now I want the hardcover edition. (to put it on display on my desk of course)
You can copy the image, paste it into Word and print it.
I closed my browser for 5 minutes and then wrote down what I remembered. I've printed out these pages and put them in a splendid ring binder. The hardback edition therefore takes pride of place on my shelf, and by the logic of the authors I wrote it myself.
That's a great idea and I'm glad I thought of it.
I've seen this cover around for a while as a sort of joke image. I never realized I had made it into a book.
joke image -> joke book. It's 4 pages (not to knock the content, I haven't actually read it. The author does say " The book is written in a deadpan manner.")
(comment deleted)
I feel like this is a smug joke about a problem which doesn't actually exist. Effective engineers know how to look things up. Stack Overflow is one very effective way to look things up or at least provide pointers to authoritative sources of information which might otherwise be difficult to uncover or not obvious from the original source.
I've certainly seen great slabs of code that have clearly been copied from somewhere, perhaps not Stackoverflow.

Unless there is some type of reference, you have no idea of what is going on or why...

Not everyone is like you. There are devs who use the internet to understand things, and when they see some code on the web they use that as a template to help with their particular problem. There are other devs who barely deserve the name, who struggle with everything they run up against and who blindly copy/paste code without an understanding of how it works or what it means in an effort to get the problem to go away. And of course there are folks of varying levels of talent in between.

Yes, it is a bit of a smug joke, and a bit of self-deprecatory humor as well. Since plenty of people leverage the expertise of folks on stack overflow and are still effective devs in their own right. But it feels like you would be shocked by the notion that a significant number of professional developers would struggle with, say, the fizzbuzz problem. But everything I've ever seen indicates that there is a huge class of developers who earn decent wages doing coding for a living at lots of places who nevertheless struggle with coding at a basic level.

Not shocked at all. I don't think people that can't do fizzbuzz are using stack overflow at all. Part of why they can't produce anything is because they can't use reference resources effectively and thus never learn anything.
"Using code from Code Review and Code Golf may also be rather unethical, since you are just taking advantage of the fact that everything is automatically licensed on Stack Exchange under CC-BY-SA 3.0 with no exception."

I disagree. If you knowingly publish your code on such sites, then you know ahead of time that the license is CC. Others are abiding well within their rights as licensees if they use your published code as such.

It's only unethical if CodeReview did not clearly and plainly disclose their licensing agreement a priori, or if, as a licensee, you violated the terms of that license.