TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How often do people copy and paste from Stack Overflow?

221 pointsby prakhargurunaniabout 4 years ago

53 comments

dkerstenabout 4 years ago
Interestingly, I don&#x27;t remember when the last time I did so was. I seem to be relying on SO less and less. I do sometimes use it as a quick reference, usually because its one of the first results on search engines, but its typically just a quick &quot;ah, that&#x27;s the function for that&quot; or &quot;ah, that&#x27;s how you do X&quot; rather than actually copying code.<p>I&#x27;m trying to think what&#x27;s changed, I guess I&#x27;ve just been writing stuff that either I&#x27;m super comfortable with or is niche enough that there&#x27;s not that much on SO that&#x27;s helpful. Looking in my browser history, the last thing I looked for that I got an answer on SO is what&#x27;s the differences between C++&#x27;s std::scoped_lock and std::unique_lock, which was a few days ago. I still use SO, just not as frequently as a few years ago.
评论 #26870566 未加载
评论 #26868748 未加载
评论 #26869753 未加载
评论 #26868863 未加载
评论 #26868913 未加载
评论 #26870554 未加载
评论 #26870382 未加载
评论 #26893665 未加载
评论 #26870926 未加载
arduinomancerabout 4 years ago
IMO its not even that we&#x27;re copying people&#x27;s logic, its just that stack overflow acts as a weird sort of crowd-sourced centralized documentation for programming languages.<p>For example if I forget the name of a function for something in a particular language I don&#x27;t even go to the docs, I just google something like &quot;python reverse list&quot; and click the first SO link.
评论 #26865760 未加载
评论 #26865711 未加载
评论 #26867110 未加载
评论 #26866765 未加载
评论 #26866375 未加载
评论 #26868516 未加载
评论 #26871267 未加载
评论 #26865798 未加载
评论 #26866058 未加载
评论 #26866664 未加载
评论 #26867295 未加载
busterarmabout 4 years ago
I once had a brief contract helping out a two-person Rails consultancy where pretty much all they did was follow RailsCasts.<p>They got very angry at me several times for not doing things &quot;the Rails way&quot;. We were on Rails 4, which I already had loads of experience with. The RailsCasts they were following were written for Rails 2. They literally had no idea all of the ways Rails had moved on between those versions.<p>Their codebase was an absolute mess as well. This was an application that was supposed to contain medical records and it had broken routes that were leaking data everywhere unauthenticated. And they were mad that I spent two weeks cleaning all of that up and bulletproofing their application.<p>I was happy to move on from that one, but it taught me a lesson about just how valuable sales skills are. These two people were living a comfortable lifestyle off a single paying client (essentially getting money indirectly through DARPA) and were punching way above their weight technically.
评论 #26867165 未加载
评论 #26865812 未加载
gregmacabout 4 years ago
I was working at a company that was acquired a few years ago, and part of the deal was them doing a source-level audit of code, mainly looking at licenses and open-source. They used some software which could detect copy-pasted source code, and had Stack Overflow indexed.<p>The Stack Overflow stuff was a massive, massive pain, for several reasons.<p>For one, it&#x27;s not clear how CC-BY-SA applies to code[1]. This involved many long meetings with copyright lawyers. They ended up asking for all this to be removed, which our C-level people eventuality agreed to.<p>We had to then go through several hundred &quot;flagged&quot; things (in a hundreds of thousands of lines codebase) and fix or justify everything.<p>Only a few cases were outright copy+paste of a big function or class, and those were at least straightforward: rewrite. Usually it was old code anyway, and replaced with newer style, much more concise code.<p>Tons were one- or two-line things, which involved lots of arguments along the lines of &quot;that is <i>the</i> way to open a file in append mode in this language, and logFile is the appropriate variable name in this case!&quot; This is really a failing of the tool they were using, but it still required answering.<p>The funniest was a handful that were <i>our</i> answers: they were copy+paste our team had done from our code to SO! (Nothing proprietary, just a few lines of an algorithm or solving whatever random problem).<p>Anyway, this experience left me extremely cautious about introducing <i>any</i> external code (as opposed to libraries) into a codebase. OSS libraries with permissive licenses (MIT, BSD, etc) are easy to deal with: it&#x27;s straightforward to comply and being a library means the code is nicely compartmentalized if you need to replace&#x2F;remove it.<p>[1] <a href="https:&#x2F;&#x2F;opensource.stackexchange.com&#x2F;q&#x2F;1717" rel="nofollow">https:&#x2F;&#x2F;opensource.stackexchange.com&#x2F;q&#x2F;1717</a>
评论 #26869748 未加载
评论 #26871431 未加载
评论 #26869730 未加载
fredleyabout 4 years ago
I have spent multiple hours digging into something, found <i>my own Stack Overflow answer</i> and pasted it back in.
评论 #26865630 未加载
评论 #26869518 未加载
评论 #26869428 未加载
评论 #26866681 未加载
评论 #26865570 未加载
nynxabout 4 years ago
I&#x27;ve found that the amount I use stackoverflow is inversely proportional to the quality of the documentation and the strength of the type-system of the language I&#x27;m using.
评论 #26868825 未加载
评论 #26868726 未加载
评论 #26875039 未加载
cratermoonabout 4 years ago
Often enough to inspire this: <a href="https:&#x2F;&#x2F;github.com&#x2F;drathier&#x2F;stack-overflow-import" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;drathier&#x2F;stack-overflow-import</a>
评论 #26865380 未加载
评论 #26869015 未加载
LinuxBenderabout 4 years ago
On a side note, use caution when doing a copy&#x2F;paste from a website into a terminal. There are several things you can do to reduce the risk. Here [1] is a demo of one risk vector. The article links back to a discussion here on HN from 2013 on some things you can do to mitigate the risk.<p>[1] - <a href="https:&#x2F;&#x2F;thejh.net&#x2F;misc&#x2F;website-terminal-copy-paste" rel="nofollow">https:&#x2F;&#x2F;thejh.net&#x2F;misc&#x2F;website-terminal-copy-paste</a>
评论 #26868768 未加载
评论 #26868023 未加载
f154hfdsabout 4 years ago
So I have copied this answer into probably 100 separate bash scripts over the years:<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;246128&#x2F;9084915" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;246128&#x2F;9084915</a><p>I&#x27;ve thought about saving it somewhere (sometimes I copy from my other existing scripts) - but it&#x27;s just too convenient to google&#x2F;copy directly out of the webpage.
评论 #26868783 未加载
cardanomeabout 4 years ago
I think copy and pasting code is very useful for a junior developer and nothing to be ashamed of. You will learn by debugging and modifying it.<p>As a more senior person, I rarely do copy whole snippets. I will look for general inspiration or to confirm my idea and check if there is a better solution. I wont blatantly copy as it rarely fits into my architecture and code style so it is faster to just directly write it how I need it.
评论 #26869890 未加载
ianmcgowanabout 4 years ago
I do it all the time for clever tricks (especially SQL things like tally tables), but like to leave the permalink to the answer that seems best (from the share link below the answers) as a comment in my code.<p>If it&#x27;s something I had to google for once, it&#x27;s likely needed in the future and sometimes it&#x27;s easier to search my own code for all SO links than follow the thread through the labyrinth again...
评论 #26865734 未加载
sneakabout 4 years ago
I think whatever feature in my browser lets websites determine when I copy text should be ripped out, along with the site&#x27;s ability to snoop on my scroll position.<p>The sandbox has been broken.
评论 #26866513 未加载
metalforeverabout 4 years ago
This is an unpopular opinion but I think the answer to this may depend on the age of the engineer.<p>For example, I learned programming before stack overflow. I have most of the standard library syntax in my head and mostly look at spec documents. Once in a great while I will go on stack overflow if I can’t debug a problem but I don’t post on there .<p>In the same way, I suspect some engineers like using video to learn things or debug things but it’s not for me.
评论 #26868831 未加载
评论 #26867407 未加载
评论 #26865237 未加载
评论 #26866721 未加载
评论 #26865802 未加载
评论 #26866358 未加载
kemiller2002about 4 years ago
Ha! Joke&#x27;s on them. I type it out so it makes it look like I&#x27;m doing more work. (But in all seriousness, I normally do type it out, so it forces me to remember what I&#x27;m using better.)
评论 #26865073 未加载
评论 #26865528 未加载
评论 #26864982 未加载
评论 #26865341 未加载
dustedabout 4 years ago
I don&#x27;t copy and paste from SO.<p>I sometimes type what is shown on SO, but not copy&#x2F;paste, this just sits better with me, I get a deeper appreciatio of what it&#x27;s doing even if I&#x27;ve read the code and understood it well, and it lets me use names that fit with the program and context of what I&#x27;m doing.<p>Often, I use the example on SO not as the solution, but as inspiration for one, and so I type only a modified subset of it, and at that point, it&#x27;s just a lot easier to type it yourself than to copy&#x2F;paste&#x2F;modify it anyway.
ziml77about 4 years ago
It&#x27;s a great way to get individual functions for odd tasks instead of needing to pull in a whole library. Just last week I needed to implement POPCNT in C# since we&#x27;re not using .NET 5 so BitOperations.PopCount is unavailable. The naive implementation is easy but this was needed in our core networking code so easy performance wins are good to go look for.<p>A quick Google search brought me to a question on Stack Overflow from someone looking for the exact same thing: a good implementation of POPCNT that works for a single byte[1]. I checked out the answers, found the one that looked the best, pasted it into LINQPad to test all the combinations, and then pasted it into our code with a comment that had the Stack Overflow answer&#x27;s permalink. I don&#x27;t see anything wrong with copy-pasting from SO that way. It&#x27;s quite handy.<p>[1]: Yes, if I&#x27;m looking for maximum performance, working with just a byte at a time is not great. But for the data I&#x27;m working with, you need to know the population of a byte to find the next byte that needs to be counted.
Waterluvianabout 4 years ago
Tangent:<p>Does anyone ever intentionally NOT copy and paste, even from their own code?<p>I usually copy&#x2F;paste, but sometimes I&#x27;m inclined to type it out again because it&#x27;s just... It&#x27;s just really satisfying.<p>It&#x27;s like a ballet move or a really graceful hockey play. I find the act of physically typing out some code to be graceful and elegant and just so darn satisfying.
评论 #26868926 未加载
lucb1eabout 4 years ago
I wish they had shared with users how many of their answers&#x2F;questions&#x2F;comments were copied from. Views are aplenty but maybe one in a dozen, perhaps one in a hundred of the readers that found it useful actually upvote. I might even link an answer to friends, they express having found it interesting or useful, but no upvote comes in. Not enough karma is often a reason, but also most just don&#x27;t habitually upvote useful posts and are not usually logged in.<p>I&#x27;d love to know how many people make use of my answers, and while there are per-page view counts, of course a view doesn&#x27;t mean I really helped someone. Number of copies during these two weeks would have been very nice to get as a statistic!
评论 #26868911 未加载
danarisabout 4 years ago
Personally, I try not to copy &amp; paste things I don&#x27;t understand—unless there&#x27;s not enough information around the code to explain it, in which case I first copy &amp; paste it, then tweak it and test it enough that I <i>do</i> understand it.
beermonsterabout 4 years ago
Check out this scary VS extension then!<p><a href="https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items?itemName=Alexey-Strakh.stackoverflow-search" rel="nofollow">https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items?itemName=Alexey-S...</a>
docflabbyabout 4 years ago
The quality of SO has deteriorated rapidly over the last few years.<p>I think the rot started when they brought I the careers section. People more interested in gaming it to get a job then help each other out.
ChefboyOGabout 4 years ago
It&#x27;s weird, nowadays I think the only times I use SO as a reference are when I&#x27;m hitting something that is very product-specific (i.e. a weird error message in Typescript that doesn&#x27;t quite make sense). In those situations, there&#x27;s usually some SO thread that explains the quirky behavior and workarounds in depth. Otherwise, I&#x27;m never there anymore, which certainly wasn&#x27;t the case years ago.
JoeAltmaierabout 4 years ago
Stack Overflow suffers from Internet Ossification. Thousands of posts in the search engine but most are for obsolete questions. So lots of chaff shows up.<p>Sometimes its a melancholy thing - looking for a latest-version issue and some 12-versions-back question shows up from 2002. Still unanswered and I think of that poor soul still hoping for some direction after all these years!
exhilarationabout 4 years ago
One of the interview questions I ask is, &quot;if you run in a problem you can&#x27;t solve, where do you go online to find answers?&quot; Anyone that doesn&#x27;t answer Stack Overflow is - in my opinion - either lying or very, very new to the industry. (This is for .Net&#x2F;C# jobs so maybe it&#x27;s different for other languages.)
评论 #26865547 未加载
评论 #26865488 未加载
评论 #26865625 未加载
评论 #26865524 未加载
评论 #26865556 未加载
评论 #26868723 未加载
评论 #26865577 未加载
评论 #26865665 未加载
评论 #26865754 未加载
评论 #26865845 未加载
shannifinabout 4 years ago
&gt; &quot;One out of every four users who visits a Stack Overflow question copies something within five minutes of hitting the page.&quot;<p>Ha. Before reading the article I thought to myself &quot;I probably copy about 1&#x2F;4th of the time...&quot; Usually just syntax I can&#x27;t keep straight.
Xavdidtheshadowabout 4 years ago
&gt; UPDATE: There has been a lot of interest in purchasing a real life version of our prank. The good news is we anticipated this might happen and we’ve been working on something along these lines. Stay tuned for more!<p>Nice! I thought it was a cute idea and I like little useless hardware.
rriepeabout 4 years ago
<i>copy and paste find and replace<p>those are fine, but use a tab not a space<p>CTRL shift L or I&#x27;m in hell<p>but please, don&#x27;t merge my rebase</i>
analog31about 4 years ago
I&#x27;ve done it pretty often. Usually I paste the code into a Jupyter notebook (where I do all of my trial and error stuff), modify to suit my need, then add a comment with a link to the original page. I do this with anything that I glean from the Web.
elpakalabout 4 years ago
How about a GitHub Action which scans lines of code in a PR patch for exact matches on SO? As a reviewer it would be helpful to see 1) was copy pasta 2) what SO comments say about the code (eg has it broken)
raspasovabout 4 years ago
Q: How often do people copy and paste from Stack Overflow?<p>A: Very rarely. And when I do, it really depends on the language.<p>If you find a solution for Clojure, chances are it&#x27;s pretty high quality. The fact that the language has been essentially stable for 10 years helps. The language culture around minimizing complexity and a strong preference for pure functions also doesn&#x27;t hurt.<p>For other more &quot;churny&quot; &amp; mutable languages you gotta be careful. It could be a good solution, or it could be old, unwieldy or excessively complex.
foucabout 4 years ago
It would be interesting to see cases where the most upvoted answer isn&#x27;t actually the most copied answer. Stackoverflow could potentially rank highly copied answers higher.
intrasightabout 4 years ago
I copy and paste into my project diary. Which will also have the question that I&#x27;m trying to answer (and perhaps exactly what I googled). And of course the URLs of useful things I found. They are often SO. And then I may copy and paste into my diary. Rarely will I paste into source code. Copy and paste errors I find to undo the benefit vs just typing it in and using my own code style.
aejnsnabout 4 years ago
I did work for a small company whose “director of software development” had copied and pasted verbatim basic details from SO enough for it to become a theme. He would copy long, drawn-out, language-level examples from SO rather than use the idiomatic, syntactic sugar provided by the framework and its docs. The duplication would drive me insane.
vmceptionabout 4 years ago
Its one thing when you need to remember how to make a GET request with a certain framework, you can copy and paste that answer, its another thing when you need to integrate the request into your asynchronous queue and store the results in an ORM with JSON serialization, cant copy and paste that
nathiasabout 4 years ago
I have copied the code one time in 2 years, but I ended up heavily modifying and then refactoring anyway ...
StreamBrightabout 4 years ago
Way too often. One of the bugs I had the opportunity to debug was caused by a frontend developer who copy pasted invalid JSON from SO and pushed it all the way to production. He used different quotes: “ &quot;.<p>When the data did not show up on the dashboard he just put the blame on the data team.
renewiltordabout 4 years ago
All the time, man. I cargo cult the fuck out of the following:<p><pre><code> # https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;246128 DIR=&quot;$( cd &quot;$( dirname &quot;${BASH_SOURCE[0]}&quot; )&quot; &amp;&gt; &#x2F;dev&#x2F;null &amp;&amp; pwd )&quot;</code></pre> is a
nitwit005about 4 years ago
I&#x27;d be curious at the length distribution. I tend to copy search terms (LongJavaClassNameThingy) to find some separate documentation.<p>I assume what&#x27;s going on with the subset of high rep people that do a lot of copying is they&#x27;re doing searches for duplicate posts.
virtue3about 4 years ago
Anytime I have a build config issue or something with webpack I&#x27;ve definitely been guilty of just pasting lines and hoping they work.<p>It&#x27;s still super handy when updating something to a major version and figuring out what broke.
holodukeabout 4 years ago
Every time when I need to unpack or pack something with tar. Or when I need the email regex validator. Or when I need the &#x27;less&#x27; command to scroll to the last line. My memory is weak :)
alfiedotwtfabout 4 years ago
I&#x27;ve seen more than one Stack Overflow answer straight copy-pasted into a single function, much of it leading to dead code anyway, and not cleaned up before being pushed into production.
stadiumabout 4 years ago
I closed the page in frustration when I got this popup to subscribe and haven&#x27;t been using it as much since. I thought it was real. Or maybe it was and this is damage control?
supermattabout 4 years ago
Im honestly surprised that people use stack overflow any more. In the early days, I gained a large amount of reputation both answering and asking questions. It felt like participation.<p>Now it is almost impossible to ask a valid question without it getting flagged for some reason. Questions are closed as duplicate, when they clearly aren&#x27;t. If you follow the &quot;new&quot; feed, you can see valid questions getting closed before your eyes. Now I just stumble on it from google searches - and most of the time the answers are of poor quality, or to do with an outdated language or product feature.<p>It is sad, because it was an awesome Q&amp;A site.
TruthWillHurtabout 4 years ago
&quot;We pretty much captured everything except the actual text being copied.&quot;<p>Didn&#x27;t realize I need to browse Stack Overflow in incognito mode...
johjohjohabout 4 years ago
Don&#x27;t paste from stackoverflow and do not hire people who paste from stackoverflow or anywhere online. This is literally how software is compromised. I worked with people at another company who had compromised a small part of Google and several banks this way. They contacted the security department later but they were surprised by the number of companies they were able to compromise just by posting instructions online.
评论 #26865505 未加载
评论 #26865455 未加载
tabtababout 4 years ago
If terrorists really wanted to disrupt civilization, then S.O. would be a prime target. I&#x27;m just the messenger, shore it up, you&#x27;ve been warned. I&#x27;d estimate it solves at least 1&#x2F;3 of the glitches I encounter from day to day.<p>That being said, I can&#x27;t stand their all-or-nothing moderating. Let low-rated messages exist, but be hidden by default, similar to Slashdot and Reddit.
math-devabout 4 years ago
All Day, Everyday.<p>(p.s. SO Blog is really cool - they always post many good and informative articles there).
sys_64738about 4 years ago
It&#x27;s often faster to google on stack overflow for python code than write it yourself.
chensterabout 4 years ago
Pastegrammer
ai_iaabout 4 years ago
I don&#x27;t always copy code, but when I do it&#x27;s always regex !
podikiabout 4 years ago
....I have lots of questions about this &quot;homegrown web tracking tool&quot; (assuming this isn&#x27;t still part of a joke?). What??? Was this opt-in? Did they track across everyone? What was collected? This is troubling, to say the least.
评论 #26865663 未加载
评论 #26865002 未加载
aussieguy1234about 4 years ago
After 10 years of coding I visit stack overflow less and less. In fact when I first started there was no stack overflow, we had to rely on Google.<p>I find it useful to educate other engineers on best practices. There are good posts on MVC, SOLID, TL;DRs of popular books like working effectively with legacy code etc.<p>I find it useful to see how different people have approached the same problem. I&#x27;ll generally look at multiple questions and answers before deciding on my own approach (not necessarily the ones I saw on SO).
spaetzleesserabout 4 years ago
I never copy&#x2F;paste directly but I try to understand what’s going on. It seems there are two kinds of devs: some that just want things get done and others what want to understand. The people who just want get things done will probably be happy copying some code verbatim.