Live data from Hacker News

How often do people copy and paste from Stack Overflow?

stackoverflow.blog

121–130 of 243 posts

Re: How often do people copy and paste from Stack Overflow?

#121
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

Re: How often do people copy and paste from Stack Overflow?

#122

On a side note, use caution when doing a copy/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. [1] - https://thejh.net/misc/website-terminal-copy-paste

In recent Bash versions this seems to have been fixed (available in Debian Bullseye, currently the 'testing' branch): when you paste something, it'll never auto-execute, even if it contains newlines.

It's actually quite annoying as I'll often copy from my terminal itself, purposefully with the trailing newline, and it now refuses to execute. I need to move my hand from mouse to keyboard to hit enter and then (often) back to mouse.

Re: How often do people copy and paste from Stack Overflow?

#123

So I have copied this answer into probably 100 separate bash scripts over the years: https://stackoverflow.com/a/246128/9084915 I've thought about saving it somewhere (sometimes I copy from my other existing scripts) - but it's just too convenient to google/copy directly out of the webpage.

That link goes to:

> a useful one-liner which will give you the full directory name of the script

So we don't all have to click to find out what this is about...

Re: How often do people copy and paste from Stack Overflow?

#124
post #56

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. If it's something I had to google for once, it's likely needed in the future and sometimes it's easier to search my own code for all SO links than follow the thread through the labyrinth again...

Stack Overflow answers are licensed under a CC BY-SA license.[0] If you copy and paste a function without (at least) linking to the question, isn't that copyright infringement? [0] https://meta.stackexchange.com/questions/333089/

It depends. The short of it is that a few lines are often not copyrightable at all, but otherwise you're right.

Hence, in my code I actually link to the answer when I think it might meet the bar for copyrightability. One example that comes to mind is a string->number hash function in javascript to assign random but consistent colors to items; I would use the resulting number as hue in CSS.

Re: How often do people copy and paste from Stack Overflow?

#125

IMO its not even that we're copying people's logic, its just that stack overflow acts as a weird sort of crowd-sourced centralized documentation for programming languages. For example if I forget the name of a function for something in a particular language I don't even go to the docs, I just google something like "python reverse list" and click the first SO link.

Just in case this idea needed any more validation, a few years ago Stackoverflow themselves launched a 'Stackoverflow for Documentation' product [0], and eventually shut it down because, as was probably obvious to many going in and certainly in retrospect, this product was of course.. just Stackoverflow. [0] https://meta.stackoverflow.com/questions/354217/sunsetting-d...

It’s a shame, I really liked where that product was going. I work best with concrete examples.

Re: How often do people copy and paste from Stack Overflow?

#126
post #116

I'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'm using.

That's me with Python... For some reason I find the documentation extremely cumbersome to navigate and parse. It's just so wordy and dense. And there are barely any examples - which is what I'm usually looking for instead of having to read a whole paragraph.

The Elixir documentation on the other hand is succinct and always features basic examples for every function. It's a joy to work with.

Re: How often do people copy and paste from Stack Overflow?

#127

This is an unpopular opinion but I think the answer to this may depend on the age of the engineer. 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 . In the same way, I suspect some engineers like using video to learn t…

> This is an unpopular opinion

[citation needed]

These kinds of comments just make those who agree be sure to upvote, they're part of this perceived in-crowd after all, and most of the time (here too) it's fairly obviously true so a lot of people will upvote. Of course a newb will copy more code than a veteran. They also have very different functions in organisations on average. It's neither an opinion nor unpopular.

Re: How often do people copy and paste from Stack Overflow?

#128

Interestingly, I don'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 "ah, that's the function for that" or "ah, that's how you do X" rather than actually copying code. I'm trying to think what's changed, I guess I've just been writing stuff th…

StackOverflow is great when you don’t know where to start looking for a solution. Whenever I’m in a new domain I’ll spend a lot of time on SO, spending less time there as I get more comfortable.

Put another way, I spend 100% less time in high school than I used to, but HS is still a valuable resource.

Re: How often do people copy and paste from Stack Overflow?

#129
I wish they had shared with users how many of their answers/questions/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't habitually upvote useful posts and are not usually logged in.

I'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't mean I really helped someone. Number of copies during these two weeks would have been very nice to get as a statistic!

Re: How often do people copy and paste from Stack Overflow?

#130
post #122

On a side note, use caution when doing a copy/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. [1] - https://thejh.net/misc/website-terminal-copy-paste

In recent Bash versions this seems to have been fixed (available in Debian Bullseye, currently the 'testing' branch): when you paste something, it'll never auto-execute, even if it contains newlines. It's actually quite annoying as I'll often copy from my terminal itself, purposefully with the trailing newline, and it now refuses to execute. I need to move my hand from mouse to keyboard to hit enter and then (often)…

this is called "paste bracketing" if you want to search for it!
Post reply on HN