4 ms·
This might be a joke but everybody does it manually for real. Whenever I copy-paste some tricky function from SO I like to add a code comment with the url point
by guelo 10y ago
This might be a joke but everybody does it manually for real. Whenever I copy-paste some tricky function from SO I like to add a code comment with the url pointing to the stackoverflow.com answer. This allows future maintainers to refer back to SO and see if a better answer has surfaced or read comments about any issues.
- jaredsohn 10y agoI do it for that reason but also for license attribution and indicate that I didn't write it.
- vmarsy 10y agoAlmost 3 years ago Visual Studio demo-ed a feature that would copy-paste code from StackOverflow, while automatically renaming the variables to fit your code : https://blogs.msdn.microsoft.com/visualstudio/2014/02/17/introducing-bing-code-search-for-c/ https://blogs.msdn.microsoft.com/visualstudio/2014/02/17/int... The tool is available here: https://visualstudiogallery.msdn.microsoft.com/a1166718-a2d9-4a48-a5fd-504ff4ad1b65 https://visualstudiogallery.msdn.microsoft.com/a1166718-a2d9...
- Biganon 10y agoI never, ever copy paste code, unless it's really long. I always end up rewriting everything myself, so I have the time to think about what's happening.
- andybak 10y agoHmmmm. I'm the other way round. I copy and paste short snippets because I'm lazy and I can see if they are ok at a glance. Longer code I'll go through line by line and try and 'touch' each line to force me to think about it.
- clifanatic 10y ago> everybody does it manually for real I've been programming professionally for much longer than there's been a stack overflow. I have never, ever, cut and pasted code from stack overflow.
- hydrogen18 10y agoI've worked with people who did it with pride. When I pointed out we had no license for the code, they proudly told me anything without an explicit license was public domain. I quit not longer after that.
- Latty 10y agoStackOverflow code is under a license - cc by-sa 3.0. They were planning on clarifying this by moving to the MIT license, but there was some pushback on that and they are holding off for now at least: https://meta.stackexchange.com/questions/272956/a-new-code-license-the-mit-this-time-with-attribution-required?cb=1 https://meta.stackexchange.com/questions/272956/a-new-code-l... Besides that, most snippets are small and trivial enough that using them would easily fall under fair use. Obviously, your case showed a lack of care on their part, but you can use SO code.
- guelo 10y agoHow do you know how to loop over an array for (int i=0;... ? You didn't invent that code. You read it somewhere many years ago and have copied it over and over many times since then. Do you have a license for that code? The author you learned it from did not invent it either, was he violating a license? It wasn't even invented by Dennis Ritchie since he copied the idea from earlier languages. My point is that trying to copyright basic snippets of code is just ridiculous, it's something lawyers have tried to force on programmers but it makes no sense. We would be completely unable to program at all if we listened to lawyers all the time.
- shados 10y agoWell, actually I just typed [] in my browser's console, expanded it, then expanded the prototype and found a method called "forEach" which sounded like what I wanted. Fiddled with it a bit until it worked. Clean room usage~