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:
- 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.
- Hyperlink directly to the original question on the source site (e.g., https://stackoverflow.com/questions/12345)
- Show the author names for every question and answer
- 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)