78

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?

closed as off-topic by Sonic the Inclusive Hedgehog, Pikachu the Watermelon Wizard, Robert Longson, Glorfindel, Ward Feb 9 at 18:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "The problem described here can no longer be reproduced. Changes to the system or to the circumstances affecting the asker have rendered it obsolete. If you encounter a similar problem, please post a new question." – Sonic the Inclusive Hedgehog, Pikachu the Watermelon Wizard, Robert Longson, Glorfindel, Ward
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    Also, what about inline code? – Doorknob Dec 16 '15 at 21:35
  • 5
    I don't think any of your examples in this post could be copyrighted anyway, they're far too trivial – Mad Scientist Dec 16 '15 at 21:37
  • 1
    @MadScientist possibly, though that is not the impression I get from the new proposal. Either way, just imagine they are bigger. I'm too lazy to write up real examples :) – David Grinberg Dec 16 '15 at 21:38
  • 2
    I have the copyright on some of that code. My lawyer will talk with your lawyer while we have a beer, OK? – rene Dec 16 '15 at 21:39
  • 8
    print "this is really complicated to answer" – enderland Dec 16 '15 at 21:39
  • 9
    What about a precise verbal description of an algorithm? Image containing code? Image of an abstract painting which is actually a Piet program? This can of worms contains other cans of worms! – Anko Dec 16 '15 at 21:43
  • 3
    @MadScientist: But the whole post is not trivial, and the poster has copyright to its entirety. The new license proposal makes a separation between the two kinds of content in one larger piece: "code"->MIT, "everything else"->CC; if the code is "trivial" on its own, does it then fall under CC? (Not necessarily expecting you to know the answer, just re-stating the problem.) – Josh Caswell Dec 16 '15 at 21:44
  • 1
    According to your examples, evrything with = is code. – ott-- Dec 16 '15 at 21:51
  • 5
    To most non-technical people, html or other markup languages are "code". <span>So, is <em>this</> code?</span> And if it might be, what about _this_? – mattdm Dec 16 '15 at 22:01
  • 2
    @mattdm One could well argue that CSS or HTML are code (they describe how something should be rendered, and when combined with today's omnipresent Javascript they're clearly large parts of a "program" executed by your browser). Webmasters probably contains ample examples of this and can make this discussion even more complex... – voretaq7 Dec 16 '15 at 23:10
  • 4
    Also, at what point does the snippet get considered on its own versus the entire post? As this post contains code, is the entire post including the code CC as the text cannot become more exclusive (i.e. making the whole thing MIT if code is included)? Are code-only answers the only posts which would be MIT and everything else such as, "use this: $("#id")" still CC? – Travis J Dec 16 '15 at 23:58
  • 7
    And what about $f(x)=x^2+2x+1$ (on Mathematics for example)? – msh210 Dec 17 '15 at 16:39
  • 13
    This gets even more troublesome when people edit to fix formatting. Can we no longer fix un-formatted code because that would be changing the licence without permission from the owner? – Bob Dec 18 '15 at 1:51
  • 2
    So just dual licensing everything might be easier. – binki Dec 28 '15 at 1:07
  • 1
    What is code? Baby don't hurt me, don't hurt me, no more... – rickster Jan 17 '16 at 5:05
42
+200

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.

  • 28
    and we should have harmonic licence terms (i.e. the same) for them, to avoid this particular headache Yes! Yes! – Patrick Hofman Dec 17 '15 at 10:47
  • @DavidGrinberg you mean having two licenses or having just one? – eis Dec 17 '15 at 12:58
  • Congrats on 1k rep! – Shelvacu Jan 15 '16 at 23:39
  • 1
    See meta.stackexchange.com/questions/273275/… for some more info on why two licenses might be necessary. – David Fullerton Jan 19 '16 at 16:21
17

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.

1

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 Jan 15 '16 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 Jan 15 '16 at 23:51
0

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.

0

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 Jan 18 '16 at 7:49
-3

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 Grinberg Jan 14 '16 at 19:07
  • better than forcing license to everyone with no exception – XANi Jan 14 '16 at 19:11
  • why not a different markup for code that you wish to license? Make it opt-in. – AShelly Jan 14 '16 at 19:58

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