Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

The more I explore Github, the more I like it. I really enjoy how coding is becoming more social.

I'm curious as to if there are any bad practices that programmers should avoid in sharing their code with each other. And in naming bad practices, what are the best practices for code sharing?

For example:

Is it a bad practice for a single repo to have multiple scripts/projects named 'MiscProjects'? Where this repo, as the name suggest, is a collection of miscellaneous small scripts and projects. This may resemble how a programmer organizes projects on his/her local storage, but it's possibly not optimal for code sharing?

Maybe if a good README/documentation is done, it would be better? Or as long as it's well documented, anything goes?

share|improve this question

closed as too broad by gnat, MichaelT, Corbin March, mattnz, Jimmy Hoffa Sep 10 '13 at 15:13

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 8 down vote accepted

While there no 'bad practices' set in stone, likewise with other version control systems, there are conventions.

Your Git repo should be as small as possible. If you're coming from the CVS/SVN module, it was common to have a structured single repository which could compose of multiple repositories for a number of projects. The Git way is to split these up and have separate Git repos for each project. Reasons are:

  • Git is faster for smaller repos.
  • Due to its design, each operations affects the entire repo. It is inefficient to perform Git operations over necessary projects if you're only working on one of them.

Documentation, as always, is a must. While people are adept at reading code, no one wants to interpret code any more than they need to. Using the top-level README to describe the project and the structure of the Git repo will always be a good thing for those involved (or looking to get involved) in the project.

The majority of the project on GitHub conform to the conventions. Use them as examples for how to structure your future projects.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.