views:

32

answers:

2

On every new professional project I tend to (re)-create the same helpers and utils classes. It is not wheel re-invention, but rather some small tools that can fit in any project.

I wish I can keep them in a 'code toolbox' that I can re-use on each time. But I'm facing some problems (Legal question, version problem, dependencies, ...).

edit: here is a more detailed list of encountered problem:

  • legal: this code is not mine, it's owned by my company even if I wrote it. So it is not very legal to use utils part of my code in other projects (see: link text

  • version: if I create an OSS project the code will hosted on a remote source control system. But my current company project code is hosted in house source control system. How to keep both in sync ?

  • version bis: my own OSS package will be something like org.myself.greatestcodeever.utils, but the one of my company will be com.bigcorpo.dept.utils. How to keep it sync ?

  • version ter: my company have some restrictive rules about internet access. So my OSS source repository may not be available.

version --> the more annoying problem: accumulation of small problems are discouraging me.


If you have such a toolbox, how do you maintain it ?

+3  A: 

I had the same thoughts and right now I would think about creating a small open source project, attach a practical OSS license and host it on sourceforge (or something similiar).

Even if it wasn't intended to be useful for others, it would be available and maintainable outside the company.

Andreas_D
A: 

I have changed few platforms during my career, but every time everything was the same: a custom library for sharing some really useful code. It was .lib for C++ projects on Win platform, it was .NET dll with tons of common classes and helpers, it is cocoa frameworks at Mac platform right now. Sometime this libraries were split up to few.

I think this is the best way. In some simple situation you can use copy-paste, use an application for "code snippets", but in most cases some shared library helps to avoid copy-paste bugs hell, when you are not sure whether you have fixed an issue in every project that uses the same helper. When the library exists in a single instance - that makes sense.

Not sure what do you mean with "version problems" and "dependencies" - specify the situation, please.

Gobra