in reply to Introducing beta code into CPAN modules

You cannot expect your users to reinstall your module between when you put in warnings and kill the old interface. For that reason on any publically used code, it is a very bad idea to break the documented interface if it has been used in production.

If you are going to do it, then the new version at the least should be a new major version, and probably should get a different name. Otherwise if at all possible, I would provide a backwards compatibility interface.

Yeah, it sucks. But the advantage of modularity is that you will provide an interface that others can rely on to not change as you change the guts. The deal is that they don't mess with your internals, and you won't break their code. Both ends of that deal are important, and I try to avoid relying on code from people who knowingly break documented APIs in released code.

  • Comment on Re (tilly) 1: Introducing beta code into CPAN modules

Replies are listed 'Best First'.
Re: Re (tilly) 1: Introducing beta code into CPAN modules
by Masem (Monsignor) on Nov 07, 2001 at 00:09 UTC
    I agree that changing the interface is *bad*. When writing, I would try to avoid it if at all possible, and if necessary, rename functions to fix this; another advantage of perl's weak typing is that it's probably very easy to 'overload' a function to take arguments in a different order if that is changed, but again, I would (and will) try to avoid that. That said, there's other options to consider.

    That said, another thing that I've been doing, and a lot of others on CPAN apparently, is keeping the version number of what I would consider to be "use at your own risk" code at 0.xx. Once the code hits 1.xx, or any higher number, there's an implicit understanding that the code is well tested, and any additional updates are bug fixes and feature improvements, over mechanistic and behavior changes (until, of course, the next major number change). Certainly this is informal, but it seems to be consistent for module developers. Can this be a reasonable guarntee, particularly for newer (< 3 month old) modules that might yet have a large in-use distribution?

    -----------------------------------------------------
    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
    "I can see my house from here!"
    It's not what you know, but knowing how to find it if you don't know that's important