I am planning to start the public repository on github. In this repository I will be sharing code which I will be posting in my blog. I have seen lot of repositories without any license. Is it required to have a license file? Can’t I just say “You’re free to use this code in whatever way you need”? Please advise
Technically, you are not obliged to license your code at all: the default situation is that you as the author of the work are the copyright holder, and unless you give permission, nobody has any rights to your code.
Permission can be implied, e.g. if you send someone an e-mail with your code attached, that says, “here, please take this code, install it on your computer and run it”, you are implying that you agree with this particular use. Implicit permission can be a lot more subtle though, which is why anyone who has anything at stake will usually avoid using code on an implicit permission – otherwise, there’s always a risk of you claiming that you didn’t really mean to imply any permission, go to court, and make them fight an expensive lawsuit.
Another problem that often goes hand in hand with the absence of explicit usage terms is unclear authorship. If you want to use copyrighted material, you have to get permission from the author, even if the author is unknown – in other words, if you don’t know the author, you can’t get permission, so technically you can’t use the work.
Because of all this, it’s better to make the terms under which you want to grant people permission to copy, use and redistribute your code explicit. This is what a license does: it says “if you want to use this code, you have to agree to these conditions”. The remark “You are free to do with this code what you want” is a license, and it’s about as permissive as it gets – but it’s probably better to stick with an established license, because they have been reviewed by a lot of lawyers, so you can be fairly certain that the legalese actually means what you think it means. Something like an MIT or BSD license is usually appropriate if you want to be very permissive about your licensing.
5
Can’t I just say “You’re free to use this code in whatever way you need”?
That’s a license, and yes, you do need one. Otherwise, a substantial portion of people who might want to use your code won’t use it, because they don’t have explicit permission.
Public Domain software has the same problem; there’s no statement granting explicit rights to use public domain software, only the assertion that you don’t need permission.