When to Fork and When to Spoon
kimball at kimballlarsen.com
Wed Mar 8 11:25:13 MST 2006
On Mar 7, 2006, at 7:46 AM, Hans Fugal wrote:
> Here's a philosophical question for you to chew on today.
> I need an OSC library for ruby. OSC is OpenSoundControl and it's
> basically a nifty little lightweight transport-independent
> protocol. The
> spec is also lightweight and a decent programmer could implement it
> in a few hours time. But laziness trumps even a few hours so I looked
> for an existing lib and found one.
> The existing lib is good. It has the basic functionality. But I had a
> different usage pattern in mind than what the author provides. To get
> it to behave the way I want it to, I would have to basically refactor
> much of the 375-line codebase.
> So here's the two-part dilemna. First, his design will be harder to
> wrangle for my needs than a fresh design would be. So I'm faced
> with the
> technical decision to rewrite and cannibalize, or refactor. Second,
> like to not fork but let this be a natural evolution of the code, but
> how do you tactfully send a guy a total refactoring of his code?
> Especially when his English and my Japanese aren't so good. OTOH
> how do you tactfully fork?
I recall reading on David Heinmeier Hansson's blog about his thoughts on
rolling your own vs. adapting someone else's code. His feeling was
that by the time you have adjusted someone else's code to do what you
really wanted it to do, you would have been better off writing it all
scratch yourself. A case he brought up was the Salted Login
Generator - which
a lot of people have used in the past for Rails apps (myself
included). My personal
experience with the SLG was that by the time I understood all the
it did, and adjusted it to do what I really needed, I had spent about
as much time
as it would have taken me in the first place to roll my own.
it forced me to make a few compromises with other parts of the app I
in order to make the login generator work with minimal changes.
So, in short, I vote roll your own. Especially when it's only a few
hundred lines of code.
More information about the PLUG