Nobody is forcing anybody to make their code public. It's their choice. You can have your code on your machine and on your servers only. Hosting your code is an option.
And how would you enforce that? What would prevent anyone with access to the code from building it and using it? I don't see any way except maybe stripping the code of significant parts
I am under the understanding that if you don't want your code to be used in proprietary projects then you should not post it on SO. I could be wrong though. I also think you could get around this by link to your code hosted elsewhere but I believe this is frowned upon.
Sure, but that's only because if it's your own code, you don't have to follow any rules at all. You can do whatever the heck you want, up to and including making the whole thing closed source.
I post my code publicly, but with an "all rights reserved" licence. I don't mind everyone reading my code freely, but you can't use it for anything but learning. If I found out they were ingesting my code I would be angry. It's like training your replacement. I don't use GitHub, anyways, but now I'll definitely never even think about it.
reply