
Essential Copying and Pasting from Stack Overflow - tariqali34
https://www.gitbook.com/book/tra38/essential-copying-and-pasting-from-stack-overflow/details
======
valine
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.

~~~
taneq
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: ...)

~~~
milansm
> so you can come back later and understand/fix it

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

~~~
dave2000
Sure it does. Right when you're writing/updating the documentation.

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

------
eschutte2
Why copy-paste when you can autocomplete?
[https://emilschutte.com/stackoverflow-
autocomplete/](https://emilschutte.com/stackoverflow-autocomplete/)

Does anybody know how to make a Sublime Text plugin? Oh wait, I know where to
look that up.

~~~
seanp2k2
[https://gkoberger.github.io/stacksort/](https://gkoberger.github.io/stacksort/)

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

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

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

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

~~~
loco5niner
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.")

------
lolc
Now I want the hardcover edition. (to put it on display on my desk of course)

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

~~~
to3m
That's a great idea and I'm glad I thought of it.

~~~
ratfacemcgee
I'm glad my idea helped so much, friend.

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

------
ratfacemcgee
basically the only book you'll ever need

~~~
wckronholm
It's the only book I've ever written.

