creamygoodness has asked for the wisdom of the Perl Monks concerning the following question:

I'm starting to get offers from people who want to sponsor features in my CPAN distro, KinoSearch. If I'm fortunate and these continue to come in, I'm going to need a good way of dealing with them.

The first offer was easy, because it was stuff I was going to do anyway and had already planned out. So I just accepted a bounty and a due date.

One problem I see is that you don't want an individual sponsor calling the shots on a public API. That means you have to be very, very careful what you agree to, which implies a large amount of research and planning before accepting the contract. I think it also means putting in a clause inoculating the developer against financial liability should it ever prove necessary to change the API.

There's also the issue of code quality. If somebody wants quick 'n' dirty for standard contract work, no problem -- I can do quick 'n' dirty on the clock. But for open source, that doesn't fly -- it's gotta be right, and it's gotta take as long as it takes. That's either unfair to the client if you're working hourly, or fiscally unsound for the developer if you're working for a fixed fee.

The actual rate isn't a big deal. Laws of supply and demand take care of that -- if somebody wants a feature, they know how much they're willing to pay.

Any thoughts on how to structure such arrangements?

--
Marvin Humphrey
Rectangular Research ― http://www.rectangular.com

2006-06-14 Retitled by GrandFather, as per Monastery guidelines

Replies are listed 'Best First'.
Re: (OT) Sponsoring open source
by Theory (Beadle) on Jun 13, 2006 at 17:50 UTC

    Marvin,

    Congrats on the offers. That's great news. There's nothing better than getting paid to improve something you really care about.

    Kineticode does some work like this on Bricolage. The way we structure it is to really do the research ahead of time, both to understand the customer's requirements and then translate them into a generally-useful Bricolage feature. Then we examine the code to come up with a general implementation plan, calculate approximately how long it will take, double that time (duh), and then multiply it by our hourly rate to come up with a project cost.

    Then we send an contract to the customer in which we agree to do the project for the set price, and include an inemnification clause (duh2). It also states that the customer will not own the code, and that it will be contributed to the project under the same license as the project. Oftentimes we charge a lower rate for this sort of thing, since they won't get any IP out of it.

    But the short answer here is that I try really hard to do the code right from the very beginning. Most customers respect this (they don't want it to break!), and are simply happy when, at the end, it does exactly what it needs it to do (even if it wasn't in the way they originally expected). We simply don't do the quick hacks unless the customer is willing to maintain a patch themselves. And no one has gone that route.

    Now, in some respects, you have an advantage with KinoSearch. It seems like, if there isn't a <q>right</q> way to do something, like change the API, or if they just want something quick and dirty, then you can create a subclass and just have them use the subclass. You can even offer to maintain it for them (for a fee) in case something changes in KinoSearch that would cause it to break later.

    But just to reiterate: I figure out what the customer wants, figure out how best to do it in Bricolage to improve it without sacrificing code quality or consitency, and then tell them what we're going to do and how much it will cost them. I don't even give them the option to do it quick and dirty unless they ask for it.

    Works for us, anyway.

    —Theory

      Theory,

      Thanks for the comprehensive answer, it's very helpful.

      Regarding subclassing... one of the items the first sponsor wanted was a specific kind of excerpt highlighter. What I did was open up the Highlighter API to make it more customizable, then wrote the custom subclass for them. The complexity is all within the library; they should be able to maintain the custom subclass themselves. IOW, there wasn't a "right" way to do things before, but there is now. Sounds like the kind of thing you've done with "translating" into a "generally useful" feature.

      For cases where a "right" way can't be created... I dunno, I think that might not work so well. KinoSearch isn't as big as Bricolage, but it's still pretty big. Supporting hacked versions could get really complicated if the internals change. I'd lean towards declining the gig.

      --
      Marvin Humphrey
      Rectangular Research ― http://www.rectangular.com

        Sounds like the kind of thing you've done with "translating" into a "generally useful" feature.

        Yes, that's it exactly.

        And yes, if it's too hacky, by all means decline the gig. Or better still, make recommendations for a correct implementation that you'd be willing to do, instead. Be sure to include arguments as to the greater maintainability and less of a headache for them if they decide to spend a bit more and do it the right way. Most companies will agree if the difference isn't excessive. As for those who don't, who needs them?

        —Theory

      It also states that the customer will not own the code, and that it will be contributed to the project under the same license as the project.

      I've sometimes had, for odd reasons, customers who prefer to own the copyright of the code I write but are willing to licence it back to me under the GPL. So that's another option.

      Oftentimes we charge a lower rate for this sort of thing, since they won't get any IP out of it.

      Ditto. I've found this works best if you express it as a "discount" for the GPL code, rather than a premium for getting IP. YMMV.

Re: (OT) Sponsoring open source
by kwaping (Priest) on Jun 13, 2006 at 17:28 UTC
    How about custom-coding their sponsored features into a proprietary module just for them, then taking some time to "make it right" before incorporating those features into the open source version? Of course, the contract would need to be clear that you will eventually release their sponsored code into the free version, but what they're paying for is to get it when they want it, and possibly with a custom I/O that they specify.

    So basically, you'll have one official open source module, and a whole bunch of proprietary variants for which you are paid to maintain.

    ---
    It's all fine and dandy until someone has to look at the code.

      Thanks, kwaping. The advantage of this approach is that it's closer to traditional contracting, which is probably more comfortable for both parties. You'd have to apply it on a case-by-case basis though. Some of the work people are asking me to do can only happen via making some fundamental changes to the library. For stuff like that, the preliminary work might turn out to be hackwork that might not survive updates.

      --
      Marvin Humphrey
      Rectangular Research ― http://www.rectangular.com
Re: (OT) Sponsoring open source
by freakingwildchild (Scribe) on Jun 15, 2006 at 04:23 UTC
    In programming structuring you could add the subroutines as empty-ready routines in the public version and put the code in the "bleeding edge development version"; you will be able to get way ahead towards both your customer and the public API.

    Your clients will get the bleeding edge versions; while the public version will already be feature-ready for the bleeding edge patches. This way you can steam the people ready for using these development versions.

Re: (OT) Sponsoring open source
by exussum0 (Vicar) on Jun 14, 2006 at 15:49 UTC
    Simple problem, simple solution.

    Seperate your good/opensource/happy code into one place. Seperate your bad/custom/closed/less-happy code into another place.

    Your good code should always be a kernel. It's least buggy, easy to refactor and all that good stuff, reusable to all hell.

    Your custom/ugly code should wrap your good code. As features are wanted in that kernel, and things are clean in the outer layer, it works its way in. But be warned, be careful about how they interact as the outter wrapper should not influence the good code on a continuous basis. It should come in sparks of brilliance, and reealuations.

Re: (OT) Sponsoring open source
by ruoso (Curate) on Jun 15, 2006 at 19:00 UTC

    Keep a repository of patches for the non-official modifications and keep the core code clean.

    daniel