A follow up from my comment about the new license announcement and samthebrand's response (also from the new license change attempt):
The proposed new licensing terms differentiate between code and non-code. There are obvious examples of code.
int i = 42;
but there are also less obvious example of code in the following section:
int i = 42; //not in a code block
i = 42 //pseudocode
//i = 42 is a comment
i am a noob and I dont know how to use markdown. gimmie teh codez
int i = 42;//quotes not code blocks
So which one of these count as code and not? I think the most complicated case is the code in non-code blocks and the pseudocode.
@Doorknob and @Mad Scientist also brought up a good point in comments: what about trivial code that is inlined? i.e. int i=42;
@Anko brought up another good edge casepoint, what about picture-based programming languages like Piet?
6 Answers 6
The answer is: it depends, and it will probably have to be up to a judge to decide it each time. Neither SO/SE nor the poster nor an editor nor the person taking the code can decide it for all situations fully.
And, as we know, once lawyers are involved, things get messy.
IMHO there should be no distinction between code and non-code contributions, and we should have harmonic licence terms (i.e. the same) for them, to avoid this particular headache.
Update: another problem of not using the same licence for the entire post is that people would copy the code part without the explanations (to avoid having to add two distinct licences), which will end badly; if the entire post is covered by only one licence, much of the explanation could be merged into a code comment, for example.
- 
 29and we should have harmonic licence terms (i.e. the same) for them, to avoid this particular headache Yes! Yes!Patrick Hofman– Patrick Hofman2015年12月17日 10:47:05 +00:00Commented Dec 17, 2015 at 10:47
- 
 @DavidGrinberg you mean having two licenses or having just one?eis– eis2015年12月17日 12:58:03 +00:00Commented Dec 17, 2015 at 12:58
- 
 
- 
 1See meta.stackexchange.com/questions/273275/… for some more info on why two licenses might be necessary.2016年01月19日 16:21:52 +00:00Commented Jan 19, 2016 at 16:21
There is no reasonable distinction.
Due to all the problems mentioned in the comments, while some things may be clearly code and others may be clearly prose, it is impossible to draw a line anywhere. The transition from describing a process using English vs describing it using a programming language is very subtle; consider the following:
return image if alive
Is that English or ruby? Impossible to tell: it is valid as both. If we are to determine purely based on formatting, then we run into the problem of being unable to edit improperly formatted answers because that is effectively relicensing content without the author’s consent.
After thinking about it for a little bit I think the answer is self-evident.
When the content of a post is implemented in your code then it becomes code.
It is really that simple. It doesn't really matter if return image if alive is valid Ruby and English in your post. It only matters if it is valid in the program that I write with the help of your post.
This feels like a straight forward interpretation that doesn't rely on the formatting or other annotations in the post. It also makes the most sense IMO because where the MIT license is meant to be used is when XYZ leaves the post and enters code.
- 
 This almost works, but what if I want to write a blog post based on a stackoverflow answer with both explanation and code, then does my blog post also have to have the frankenstein-CC-BY-SA-MIT license?Shelvacu– Shelvacu2016年01月15日 23:47:33 +00:00Commented Jan 15, 2016 at 23:47
- 
 @shelvacu in my mind since the blog post is just a prose rehash of the SO post then it would only be CC-BY-SA. The only time I would picture a Fanken-license would be if you have a "run the codez" button in your blog for the javascript portion. Since the javascript is now truly code in the sense that it is implemented then it would probably be MIT at that point.Erik– Erik2016年01月15日 23:51:45 +00:00Commented Jan 15, 2016 at 23:51
Obviously it is up to a judge to decide, but the judge will decide based on some criteria.
I'd say in this context code is any text obviously intended to be processable by a specific parser for effect (not no-ops). When reasonable doubt can exist about that intention of the author, a text should not be code in the legal sense, even if it happens to be valid for any given parser in the world.
In that sense, a person provides code on a webpage as a substitute for providing the effect that running the code would have.
So markdown is not automatically code unless provided in such a way to be fed to a parser. Pseudo-code is not code. Mere comments are not code, because they do not have any effect when processed.
I've commented this elsewhere:
Basically, if the answer teaches basic elements of the language / framework API (i.e. from the docs, or other undocumented parts of the language / framework) - then it's just another way of writing the public-domain docs. In this case, it's not "code" for the purposes of attribution.
IMO. How could it be? All the Answerer has managed to do is write better than the docs writers.
In a strange world with singularities, all of these answers would eventually become the public docs for a language, since they've been more-heavily vetted as beneficial.
- 
 1) Many API docs are not public domain. 2) Why would another way to write the same information automatically be public domain even if they were?otus– otus2016年01月18日 07:49:31 +00:00Commented Jan 18, 2016 at 7:49
The "reasonable" way would be to add checkbox to a answer called "I want attribution", disabled by default, and then visualise it when viewing the post. That way if someone want to have their ego stroked by attribution they have that option but for (I assume, based on feedback) vast majority it would just work as before
- 
 I think thats just bad UI design..David says Reinstate Monica– David says Reinstate Monica2016年01月14日 19:07:31 +00:00Commented Jan 14, 2016 at 19:07
- 
 better than forcing license to everyone with no exceptionXANi– XANi2016年01月14日 19:11:30 +00:00Commented Jan 14, 2016 at 19:11
- 
 why not a different markup for code that you wish to license? Make it opt-in.AShelly– AShelly2016年01月14日 19:58:30 +00:00Commented Jan 14, 2016 at 19:58
Explore related questions
See similar questions with these tags.
inline code?print "this is really complicated to answer"=is code.$("#id")" still CC?$f(x)=x^2+2x+1$(on Mathematics for example)?