Im looking for suggestions and hopefully a little discussion around a problem Im facing. Ive set up a github account and Im shaping up a few of my projects to upload as part of a portfolio. I have about half a dozen personal projects that I have started but not brought to a sensible milestone. My plan is to shape them up and put them on github.
The problem is to do with shared code between the projects. Im talking about little utility classes, common algorithms, reusable Swing assemblies and the like. Things that are designed as libraries from the outset (like my 2D physics engine) are always used as libraries.
Because these are personal projects, I have taken a fairly relaxed attitude to shared code over the years. At times I have had a shared project (Java project in Eclipse) which was source controlled separately. Other times, I have copied the classes into my new project and not maintained a link to any common code. Other times I have simply rewritten the classes.
As an aside, the latter has probably been the most valuable for me in terms of learning. Each time I write some code for the functionality, it is better than the last. Revisiting a problem after a period of time lets me see it in a new light.
When I am writing code professionally, a shared library is usually the way to go. However, I want to consider ease of use for anyone downloading my source (or maybe if I start something cool, forking it so they can modify and make contributions). One option using git is a separate library repository. Another is subrepositories. Both look great if you want to include a complex library but they seem like too much effort for some silly little utility classes.
Any thoughts or suggestions?
The problem is to do with shared code between the projects. Im talking about little utility classes, common algorithms, reusable Swing assemblies and the like. Things that are designed as libraries from the outset (like my 2D physics engine) are always used as libraries.
Because these are personal projects, I have taken a fairly relaxed attitude to shared code over the years. At times I have had a shared project (Java project in Eclipse) which was source controlled separately. Other times, I have copied the classes into my new project and not maintained a link to any common code. Other times I have simply rewritten the classes.
As an aside, the latter has probably been the most valuable for me in terms of learning. Each time I write some code for the functionality, it is better than the last. Revisiting a problem after a period of time lets me see it in a new light.
When I am writing code professionally, a shared library is usually the way to go. However, I want to consider ease of use for anyone downloading my source (or maybe if I start something cool, forking it so they can modify and make contributions). One option using git is a separate library repository. Another is subrepositories. Both look great if you want to include a complex library but they seem like too much effort for some silly little utility classes.
Any thoughts or suggestions?