Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Senior Member GoCubs's Avatar
    Join Date
    Apr 2005
    Location
    Chicago, IL
    Posts
    1,569

    How much code borrowing is okay?

    Of course it's not uncommon to look at other plugins for code examples when working on your own. But how much sharing is okay?

    A number of plugins have been popping up recently that expand upon functionality provided in existing plugins. Quite often, a lot of the code is a result of a copy/paste job. For example, SlimPanelz combines RSS feeds and the graphical Weather forecasts plugins (although this plugin appears to have a cool plugin for a plugin feature). Many of the Internet radio plugins are heavily shared but have specifc tweaks for their needs.

    For quite some time I wanted to include visual forecasts in my SuperDateTime plugin, but another plugin was created that includes them before I ever got a chance to work on it. Now I could figure out how to do the graphical forecasts on my own and create my own icons as well, but it would be much easier to do a "copy/paste" job (however I'm sure it wouldnt be that easy to intergrate the code). After all, I have the weather data in text form I just need a way to draw the icons. I could then expand upon this to include MLB/NFL/etc team logos, etc.

    Is this going too far though? Just as the other plugin developer could do a copy/paste job on my sports score/etc functionality and include it in his plugin. Where do you draw the line? I feel like copying the code is wrong, but at the same time I feel like I'm prohibited from adding functionality I originally wanted (and was discussed in the forums). To further complicate things I could just do it only on my local copy and avoid everything. But then I'd have to support two versions or abandon the public version.

    Any thoughts?

    -Greg

  2. #2
    Senior Member radish's Avatar
    Join Date
    Apr 2005
    Location
    Red Bank, NJ
    Posts
    5,052
    It depends entirely on the license applied by the original author of the code. At one extreme we have closed source commercial applications from which copying is entirely forbidden, and at the other completely free code licensed under something like the BSD license which allows as much copy & paste as you like.

    There is no universal license under which slimserver plugins are licensed but the GPL is pretty prevalent. The general consensus for copying from a GPL codebase is that it's OK provided the new program is also GPL licensed (as you're creating a derivative work which is permitted provided the license is preserved). Copying from a GPL plugin to a non-GPL one would, however, require special permission from the author.

    The other thing to remember is that if there are no specific licensing terms attached to the code you should assume you may not copy it at all. The "default" copyright rules in most jurisdictions forbid any copying, modification or derivative works. You can, of course, contact the author and attempt to get their permission.

    I feel like copying the code is wrong
    It's wrong if the author hasn't given you permission, it's perfectly OK (and even encouraged) if they have - for example through the licensing they chose to apply.

    but at the same time I feel like I'm prohibited from adding functionality I originally wanted
    You're _always_ free to reimplement a given problem with your own cleanroom code. Even if it comes out looking similar, the onus is on the other author to _prove_ you copied it.

  3. #3
    Perl Commando Dan Sully's Avatar
    Join Date
    Apr 2005
    Location
    Daly City, CA
    Posts
    2,864

    How much code borrowing is okay?

    * GoCubs shaped the electrons to say...

    >Of course it's not uncommon to look at other plugins for code examples
    >when working on your own. But how much sharing is okay?


    Besides the licensing issues that radish brought up, there's also the
    question of code quality. Now my personal opinion on this (not speaking for
    Slim Devices), is a lot of the plugins out there are crap.

    Because a lot is copy and paste code, and because it's from poor examples to
    start out with it's just propogated into an unmaintainable nightmare.

    The other downside (Not that I'm trying to discourage people here), is that
    Perl is not a first language for many of the plugin authors, and Perl allows
    one to be very sloppy with their code.

    My viewpoint is: If you don't know what the code is doing, you shouldn't be copying it.

    -D
    --
    <iNoah> kernel's original recipe: 11 secret args and switches

  4. #4
    Senior Member GoCubs's Avatar
    Join Date
    Apr 2005
    Location
    Chicago, IL
    Posts
    1,569
    I understand the legalities, I was more saying on a ethical/moral standpoint. Legally it's okay for Roku to use/modify SlimServer for their interests, but at the same time many would feel it's just "wrong" to do what they've done...

    -Greg

  5. #5
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    10,315
    As I understand it you are free to copy any code you want as long as both plugins are licensed under GPL. If you copy code, just remember to give the person you are copying from some credit in the copyright text of your own plugin.

    Also remember that if your own plugin is licensed under GPL anyone is also allowed to copy your code.

    None of my own plugins would probably exist today if I hadn't copy code from other plugins. My personal feeling is that if anyone for example would like to make their own version of any of mine plugins and add new functionallity that would be perfectly fine. I would probably also look at their work and see if there were something that I could include in my own plugin. I am not sure every plugin developer feels this way though.

    If you want to make sure no one is left with hard feelings you might want to consider asking the plugin author you are copying from before you actually copy the code.
    Erland Isaksson (My homepage)
    (Developer of many plugins/applets (both free and commercial).
    If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
    You may also want to try my Android apps Squeeze Display and RSS Photo Show
    Interested in the future of music streaming ? ickStream - A world of music at your fingertips.

  6. #6
    Senior Member radish's Avatar
    Join Date
    Apr 2005
    Location
    Red Bank, NJ
    Posts
    5,052
    Quote Originally Posted by GoCubs View Post
    I understand the legalities, I was more saying on a ethical/moral standpoint.
    In most cases I don't see a difference - IMHO it's only unethical/immoral if you go against the author's wishes, in which case it's probably illegal too.

    Legally it's okay for Roku to use/modify SlimServer for their interests, but at the same time many would feel it's just "wrong" to do what they've done...
    Technically, I'm not aware of Roku actually modifying Slim code (although they do obviously sell slimproto aware devices and, I believe, distribute Slimserver in some form). But, let's assume for the sake of argument that they did. Slim Devices chose to GPL Slimserver, knowing full well that by doing so they were allowing potential competitors to use the code. They could have created their own license which was still open source (thus allowing community involvement) but with a non-compete clause - but they chose not to. Therefore, whatever you or I may think about Roku, Slim Devices have _explicitly_ stated that it's OK for them to use the software. I can't, therefore, attach any blame to Roku if they choose to do so.

    Personally, I've written closed source commercial software and I've also released source on a completly free basis. In the latter case I _want_ people to take it and use it for their own purposes - if I didn't I wouldn't have released it that way.

  7. #7
    Senior Member max.spicer's Avatar
    Join Date
    Apr 2005
    Location
    York, United Kingdom
    Posts
    1,661
    Thanks, Dan. Love you too. :-)

    Max

    Quote Originally Posted by Dan Sully View Post
    Besides the licensing issues that radish brought up, there's also the
    question of code quality. Now my personal opinion on this (not speaking for
    Slim Devices), is a lot of the plugins out there are crap.
    Some people think the title of this song is irrelevant,
    but it's not irrelevant - it's a hippopotamus.

  8. #8
    John A. Tamplin
    Guest

    How much code borrowing is okay?

    GoCubs wrote:
    > Is this going too far though? Just as the other plugin developer could
    > do a copy/paste job on my sports score/etc functionality and include it
    > in his plugin. Where do you draw the line? I feel like copying the
    > code is wrong, but at the same time I feel like I'm prohibited from
    > adding functionality I originally wanted (and was discussed in the
    > forums). To further complicate things I could just do it only on my
    > local copy and avoid everything. But then I'd have to support two
    > versions or abandon the public version.
    >

    The whole point of open-source software development is building on what
    has been done before rather than rewriting it. As Slimserver is an
    open-source project, unless the license on the particular code prohibits
    it, copying or reusing the code should be encouraged.

    Now, from a maintenance standpoint, it would be preferable if there were
    only one copy of any given piece of code. So, if you just need the code
    without changes, or if the changes can be made in a generic fashion,
    consider factoring out the code you want to use into a common module and
    modify both your code and the original code to use the common module
    instead of just cut-and-pasting the code.

    --
    John A. Tamplin jat (AT) jaet (DOT) org
    770/436-5387 HOME 4116 Manson Ave
    Smyrna, GA 30082-3723


  9. #9
    Senior Member GoCubs's Avatar
    Join Date
    Apr 2005
    Location
    Chicago, IL
    Posts
    1,569
    Quote Originally Posted by Dan Sully View Post
    Besides the licensing issues that radish brought up, there's also the
    question of code quality. Now my personal opinion on this (not speaking for
    Slim Devices), is a lot of the plugins out there are crap.
    True, but something is better than nothing. We're not writing operating systems here. If the plugin provides certain functionality that was not available previously, then it's useful. A lot of the examples out there are dated or not documented the best so it's easy for crap to propagate when people start hacking away at things they don't understand.

    Personally, I didn't have any Perl experience when I started my plugins and there's a lot of code I'm not proud of... but it works.

    -Greg

  10. #10
    Perl Commando Dan Sully's Avatar
    Join Date
    Apr 2005
    Location
    Daly City, CA
    Posts
    2,864

    How much code borrowing is okay?

    * GoCubs shaped the electrons to say...

    >True, but something is better than nothing. We're not writing
    >operating systems here. If the plugin provides certain functionality
    >that was not available previously, then it's useful. A lot of the
    >examples out there are dated or not documented the best so it's easy
    >for crap to propagate when people start hacking away at things they
    >don't understand.
    >
    >Personally, I didn't have any Perl experience when I started my plugins
    >and there's a lot of code I'm not proud of... but it works.


    Believe it or not, but I'm actually wanting to encourage people to write
    better code. I think all the plugins out there are great. But some of them do
    some pretty harmful things, and do have an effect on the overall server
    stability (not to mention spewing warn messages all over the place).

    I'm really happy when people ask questions here on how to do stuff - not that
    I want to turn this into a perl support forum, but we can at least point you
    in the right direction.

    -D
    --
    "A good messenger expects to get shot." --Larry Wall

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •