Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree with LICENSE and README file.

But having license headers on top of every file feels a bit like a corporate lawyer requirement. Is that really common in all open source projects?



   > Is that really common in all open source projects?
Common? Depends. Necessary or correct? That's a whole 'other can of worms:

Depending on the open-source license you're using it's actually _required_ to do that, although many developers (like me) don't actually do it because in reality it really doesn't matter, but strictly speaking it's the correct (and sometimes necessary) thing to do. The overall principle is that it reduces ambiguity. What if a user gets access to source files without access to the rest of the repo? Then they won't be able to know what the license for that code is. Or what if your project mixes in code from other projects for purposes such as dependency vendoring? You need to be explicit in which files are licensed how and by whom.

This stack exchange discussion is somewhat illuminating [0].

As you can see, GPL licenses require a copyright notice and a license notice on every file (although no need for the entire license). Apache v1 requires the license on every file. The MIT license is somewhat ambiguous as the definition for "substantial portions of the Software" is not clearly defined, a possible interpretation is that every single file is a substantial portion of the software, this is why some MIT licensed projects include it, in its entirety, in every single source code file.

IANAL, but Kyle E. Mitchell is, and he has an interesting line-by-line explanation of the MIT license which helped clear some of the ambiguity for me [1].

[0]: https://softwareengineering.stackexchange.com/questions/3170...

[1]: https://writing.kemitchell.com/2016/09/21/MIT-License-Line-b...


The GPL has of course been developed under heavy influence from a lawyer.


Is there any copyleft license that doesn't require this?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: