8

Is there a best practice for reusing code snippets from Stack Overflow in production code?

Personally I always do something like this:

// Handling input that is not parseable as an integer.
// Courtesy of greyfade (http://stackoverflow.com/a/5655685/2947592)
cin.ignore(numeric_limits<streamsize>::max(), '\n');

Some related questions come to mind:

7
  • 5
    wow - does meta have drive by downvote issues all the time? The only few times I have been here, anything I say seems to immediately get downvoted.
    – Tommy
    Sep 23, 2015 at 16:00
  • @Tommy Review the Voting is different on meta section of the help center.
    – Dave Zych
    Sep 23, 2015 at 16:01
  • Who knows?
    – Jeremy
    Sep 23, 2015 at 16:02
  • 3
    Thanks - I get it. However, downvoting without attempting to foster the discussion the FAQ mentions seems fruitless :)
    – Tommy
    Sep 23, 2015 at 16:03
  • @JeremyBanks - LOL, even the basic legalese in some of these licenses is rediculous!
    – Tommy
    Sep 23, 2015 at 16:09
  • Can anyone explain why this question is apparently considered off-topic?
    – wvdz
    Sep 23, 2015 at 20:03
  • If you were to make a feature-request of the "Click here to use this code" bit I would most certainly vote for it. Otherwise, generally Meta doesn't dispense legal advice. Sep 23, 2015 at 21:32

1 Answer 1

2

According to the site Terms of Service, all content is licenses under Creative Commons Attribution-Share alike license.

This FAQ article helps explain a little bit around the license as well as states that proper attribution is required.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .