# Copyright issues for code excerpts

**URL:** <https://discourse.julialang.org/t/copyright-issues-for-code-excerpts/17868>\
**Category:** Community\
**Tags:** legal\
**Created:** [November 22, 2018, 7:57am UTC](https://discourse.julialang.org/t/copyright-issues-for-code-excerpts/17868 "2018-11-22T07:57:13Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 22, 2018, 2:01pm UTC](https://discourse.julialang.org/t/copyright-issues-for-code-excerpts/17868/3 "2018-11-22T14:01:29Z")

</div>

> [@Julia equivalent of Python's "fsum" for floating point summation](https://discourse.julialang.org/t/julia-equivalent-of-pythons-fsum-for-floating-point-summation/17785/16):
>
> In my understanding code excerpts are not a problem, if they would you couldn’t use Stackoverflow or answers from this forum.

Typically, small snippets of \< 15 lines of code are considered non-copyrightable (according to the [FSF’s legal counsel](https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html)).

If someone posts 100–200 lines of code somewhere, then copying it into your code is indeed a problem if you don’t have an explicit license giving your permission. In the case of [discourse.julialang.org](http://discourse.julialang.org), the [terms of service](https://discourse.julialang.org/tos) explicitly state that contributions are provided under a CC noncommercial license, which is not free/open-source. StackOverflow also uses a [creative commons license](https://meta.stackexchange.com/questions/12527/do-i-have-to-worry-about-copyright-issues-for-code-posted-on-stack-overflow), and in particular the [CC-BY-SA license](https://stackoverflow.com/legal/terms-of-service/public) which is GPL-incompatible and is much more restrictive than the BSD or MIT licenses. So be careful about using anything longer than a few lines!

_Update_: As of 6 March 2020, the [Julia discourse terms of service](https://discourse.julialang.org/tos) were updated so that “Source-code user contributions … are **additionally** licensed under an [MIT License](https://opensource.org/licenses/MIT)”, so there should no longer be any problem in using code posted in this forum.

There are a lot of gray areas here, and you can never be 100% certain what a judge would say, but basically anything that is sufficiently “expressive” is automatically copyrighted. ([Fair use](https://www.janefriedman.com/permissions-and-fair-use/) gives some other extremely narrow exceptions that allow you to quote someone else for purposes of commentary etc.)

> [@Julia equivalent of Python's "fsum" for floating point summation](https://discourse.julialang.org/t/julia-equivalent-of-pythons-fsum-for-floating-point-summation/17785/17):
>
> IANAL, but if the paper also contains a full description of the _algorithm_ , seeing code excerpts _per se_ should not preclude one from programming the algorithm without having to worry about this.

Yes, but you have to make sure you don’t even _look_ at the excerpts and are not influenced by them. Your code needs to pass the [abstraction-filtration-comparison test](https://en.wikipedia.org/wiki/Abstraction-Filtration-Comparison_test), and you must be able convince a court that you didn’t copy any “expressive” elements of the excerpts.

---

_[View the full topic](https://discourse.julialang.org/t/copyright-issues-for-code-excerpts/17868)._
