FoxtrotUniform has asked for the wisdom of the Perl Monks concerning the following question:
This is more of a software-engineering question than anything else, but PM has some pretty good SE people. Thus:
I've written a lot of utility code for my own use. Some of it is probably genuinely useful to the rest of the world; some of it is a collection of reinvented wheels (although I like to think that my wheels are better suited to my style than what's already out there); and some of it is rather specialized to my toolkit and of limited interest to the rest of the world. A fair bit of this code is getting to the point where it should be shared between many of my projects, but I'm having trouble deciding how to divide it.
Right now, I have two major projects in usable states: a rather specific utility library (real-time 3d graphics; it's basically a wrapper around SDL and OpenGL with some extra features thrown in) and an application that uses said library. I have a few other projects that're just starting up, though, and some of the generic code in the library (things like logging routines, memory management, and so on) would be useful in those projects, although they aren't RT3D-related.
So what I have right now is One Big Library. It's useful for me, because it's easy to link to and stuff, but if I want to move my code to a different environment it all has to come along, and if I want to share my code with other people they may have to wade through a fair bit of unnecessary RT3D cruft to get the malloc() wrapper I used.
The obvious alternative is to break the One Big Library up into several smaller ones, each doing one thing (and, at least in theory, doing it well). That makes more sense from a distribution perspective, but it means that my build process gets a bit more complex, and that if someone needs all of my code they have more libraries to worry about. Breaking the code up into orthogonal, single-purpose chunks sort-of feels like the right thing to do, but it's going to add a lot of complexity.
Should I just bite the bullet and accept that I have a few weeks of refactoring ahead of me, or am I missing a third way? (And while we're at it, any pointers to papers, essays, or other literature on the subject would be greatly appreciated.)
--
F
o
x
t
r
o
t
U
n
i
f
o
r
m
Found a typo in this node? /msg me
% man 3 strfry
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Code reuse and clean packages
by Zaxo (Archbishop) on Jun 09, 2004 at 22:42 UTC | |
|
Re: Code reuse and clean packages
by kvale (Monsignor) on Jun 10, 2004 at 00:03 UTC | |
|
Re: Code reuse and clean packages
by toma (Vicar) on Jun 10, 2004 at 05:22 UTC | |
|
Re: Code reuse and clean packages
by McMahon (Chaplain) on Jun 10, 2004 at 14:58 UTC | |
|
Re: Code reuse and clean packages
by paulbort (Hermit) on Jun 10, 2004 at 17:33 UTC |