4
\$\begingroup\$

If I have a project that I uploaded to GitHub and I bring one of the classes to Code Review, how should I go about giving attribution to any improvements I decide to use in my code on GitHub?

The Attribution Required blogpost linked on the bottom of any Code Review page mentions the following requirements:

  1. Visually indicate that the content is from Stack Overflow or the Stack Exchange network in some way. It doesn't have to be obnoxious; a discreet text blurb is fine.
  2. Hyperlink directly to the original question on the source site (e.g., https://stackoverflow.com/questions/12345)
  3. Show the author names for every question and answer
  4. Hyperlink each author name directly back to their user profile page on the source site (e.g., https://stackoverflow.com/users/12345/username)

If I take part of one of my questions as an example, one of my methods was improved in the following way:

Before

private static boolean isSolution(int a, int b, int c, int d, int e, int f, int g, int h) {
    if (a + b - 9 != 4)
        return false;
    if ((c - d) * e != 4)
        return false;
    if (f + g - h != 4)
        return false;
    if ((a + c) / f != 4)
        return false;
    if ((b - d) * g != 4)
        return false;
    if (9 - e - h != 4)
        return false;
    return true;
}

After

private boolean isSolved(int a, int b, int c, int d, int e, int f, int g, int h) {
    return (a + b - 9 == 4) && ((c - d) * e == 4) && (f + g - h == 4) && ((a + c) == 4 * f) && ((b - d) * g == 4)
            && (9 - e - h == 4);
}

Is it OK to not give any attribution within the source code? Seeing as the official explanation by Jeff Atwood says it needs to be indicated "in some way", can all attributions be tucked away in a separate file with little or no mention of it in the source?

To demonstrate what I am suggesting, take the following as an example. The javadoc at the head of the class incorporating the change looks like as follows:

/**
 * This class does a.
 *
 * @author Amani Kilumanga
 */

The head of the file looks like the following:

/** 
 * 
 * Copyright (C) 2016 Amani Kilumanga
 *
 * This software may be modified and distributed under the terms
 * of the CC BY-SA 3.0 license.  See the LICENSE file for details.
 */

The attributions are then all listed in a separate file (ATTRIBUTIONS.txt), placed in the root directory of the project:

Modifications were made based on the following Stack Exchange network content:

"Question Title" (Question URL), by "Question Author" (User profile URL)

Answer (Answer URL), by "Answer Author" (User profile URL)

Answer (Answer URL), by "Answer Author" (User profile URL)

Answer (Answer URL), by "Answer Author" (User profile URL)

\$\endgroup\$
3
\$\begingroup\$

The blog you link is from 2009, seven years ago. There are plenty of discussions on meta and lengthy words in the Stack Exchange Network Terms of Service and Content Policy. But your question is more a question of should do not required to do.

Something that you can do, that I've done, is use a widget to link to code review reviews in the README, where licensing is usually located.

Something else that I do, in a project I contribute to, is indicate the author in the code. It's a bit sloppy, but it works, especially for something hosted on github.

Given that questions or answers may be deleted from codereivew and given that identity or users on SE is not verified, I think linking to questions, like how you've indicated, is fine. Maybe they go down, but the licensing on SE covers that once it's posted, it's fair play no matter what happens going forward.

If you prefer to go further with attribution - that's awesome, go for it. I haven't specifically referenced Mathieu or Zak (or others) in my open source projects on github, where I've used their input specifically for parts of [my?] code, but given the nature of open source and codereview, I don't think they mind.

However, if I were to take an entire class of Zak's, I think both he and I would prefer I say so at the top of the class.

Basically - do what you feel comfortable doing, most likely, do what you'd want others to do for you.

\$\endgroup\$
  • \$\begingroup\$ The github project you linked to is MIT, but you liked to Code Review content... I'm not clear if you used CR content in your MIT project, or if you only linked to it. I thought CR content was incompatible with MIT. \$\endgroup\$ – Amani Kilumanga Oct 9 '16 at 16:29
  • \$\begingroup\$ Thanks for mentioning the widget thing I created, I was about to mention that :) \$\endgroup\$ – Simon Forsberg Oct 10 '16 at 10:46
  • 1
    \$\begingroup\$ @AmaniKilumanga See Which licenses are compatible with Code Review? \$\endgroup\$ – Simon Forsberg Oct 10 '16 at 10:47
  • \$\begingroup\$ @SimonForsberg yeah, MIT → CC is legal, but CC → MIT is not, unless all the copyright holders of the CC content dual-license to something compatible with MIT. So just using a widget is not enough to use CC content in an MIT project. Hence my above comment. \$\endgroup\$ – Amani Kilumanga Oct 10 '16 at 12:21
  • \$\begingroup\$ @AmaniKilumanga my code is MIT, always. If it's on CR, then it's CC on CR and still MIT on mine. \$\endgroup\$ – Raystafarian Oct 10 '16 at 19:31
  • \$\begingroup\$ OK, but did you use code review contributions in your code; the code with the widget? Why is that legal? \$\endgroup\$ – Amani Kilumanga Oct 10 '16 at 22:27
  • 1
    \$\begingroup\$ @AmaniKilumanga what would be illegal about it? \$\endgroup\$ – Raystafarian Oct 11 '16 at 11:06
  • \$\begingroup\$ Maybe perusing opensource.SE would be useful. Maybe not. \$\endgroup\$ – Raystafarian Oct 11 '16 at 11:26
  • \$\begingroup\$ Let's continue this discussion in chat... \$\endgroup\$ – Amani Kilumanga Oct 11 '16 at 12:06

You must log in to answer this question.

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