I just want to make an observation about what happened on this thread. The OP asked a question about "sharing code", and the first TEN replies unanimously recommended a specific version control system and supporting website - GitHub. Unanimous, that is, except for one dissenter who acknowledged that git is the right and noble path, but confessed to using flash drives in actuality. This agreement is just one testament to the power and importance of using source control, and to the quality of Git and GitHub.
If you need more proof that Git is the way to go, consider these:
- Giant projects, like the Linux kernel source and the Android source releases are managed with git. In fact, Linus Torvalds invented git for the specific purpose of managing the kernel source.
- Perforce - whose version control system is pretty decent - is now advertising perforce/git integration and git management tools on their home page.
- I worked for a well-known company who uses Perforce heavily (in fact, they're featured on the perforce home page). And they use git all over the place, too.
- This Google trends graph shows that there's a pretty clear winner.