SharpDevelop (#develop) and the GPL

A matter of inspiration?

This is a sordid story. It involves a Code Hero, GPL'ed Software, sometimes acerbic emails and Longest Common Substring software. However, this summing up of the story is not meant to pass judgement. This is left as an exercise to you, gentle reader. You be the judge.

To promote acceptance of its .NET platform, Microsoft has started community efforts of various types, among them the institution of the 'Code Hero', an award for excellent coding using Windows Forms. Now one Tim Dawson posted an article (http://www.divil.co.uk/net/articles/designers/hosting.asp) describing the implementation of a Windows Forms Designer on June 14th, 2003. This is a topic of high interest, as the subject is not exactly over documented if you discount the three chapters in the out-of-print book Dissecting a C# Application: Inside SharpDevelop, a chapter on Forms Designers of which is available for free download. Therefore Mr. Dawson earned a Code Hero award.

Now Christoph Wille, the project manager of the SharpDevelop project does read what our fellow .NET developers write about .NET technologies, so naturally he came across Mr. Dawson's article. This was on August 1st, 2003. After reading the article and looking through the source code, Mike Krueger, the SharpDevelop senior code wrangler, found that it was quite similar to the code he wrote to implement the Forms Designer in SharpDevelop. Mr. Krueger contacted Mr. Dawson, Mr. Wille also contacted the site owners regarding possible copyright infringement of the code in question and pointing out that - should the code indeed be 'adopted' out of a GPL'ed software, that the code then also would be under GPL by necessity, which was not at all mentioned in the article. He also contacted Mr. Dawson to clear up this matter and settle any possible disputes regarding the copyright attribution of the code. Now things started to get interesting. The Code Hero award was retracted and an exchange of emails ensued between Mr. Wille and Mr. Dawson. I will quote excerpts from various emails, only adding technical explanations from time to time. As said before: You be the judge:

Mr. Krueger wrote:

>Hi
>
>I've looked at your source code and found that it
>is derived from SharpDevelop source code and
>therefore must be released as GPL.
>
>For a nearer description what GPL is look at:
>http://www.gnu.org/licenses/gpl.html
>
>btw. all derived source code (even the VB.NET port)
>and all projects included needed to be GPL'ed too.
>
>Regards
>Mike

Mr. Dawson had to say this:

>Hello,
>
>All the code in my article is written from scratch by me. Make no mistake, I
>have inspected your SharpDevelop code and found it to be almost a direct
>copy of poor Eddie Sheffield's efforts, which were posted on your own forums
>and I haven't seen you credit him once. Mine is my own work.
>
>Don't try anything like this again. I have tried your IDE, and believe me, I
>would have nothing to do with its code.
>
>Tim Dawson

Not exactly the most courteous email ever, but then every man has his own style. As the SharpDevelop Core team ws cc'd by Mr. Krueger, Mr. Wille decided to then take up correspondence with Mr. Dawson:

>One of our programmers already contacted you regarding you copying
>source code from the SharpDevelop project. You are misappropriating the
>ownership of this code, and you are misleading your readers into
>thinking that the source code can be used without limitation when in
>fact it is placed under the GNU GPL which has a very strict stance on
>derivative work.
>
>We expect that you (a) place your code under GPL and clearly state that
>it is under this license (b) state where "your" code originated from.
>
>In expectation of your reply,
>  Christoph Wille
>  SharpDevelop project manager

Mr. Dawson replied as follows:

>Christoph,
>
>I wasn't going to take this matter any further. As you have now
>contacted another business accusing me of using SharpDevelop code as
>part of my article, I am forced to discuss with you what elements you
>think I used and come to an agreement. I spent the last half hour
>comparing our respective code, and have found a few areas very similar
>in implementation but most to be completely different. The nature of the
>code in question and the fact that we are implementing the same
>interfaces to get the same behaviour means that similarities are
>unavoidable.
>
>The fact that Microsoft has taken the links to my work offline means you
>have defamed me, and I am not happy about this. You are using the size
>of your product and so far a claim that my work "is derived from
>SharpDevelop source code" to publicly harm my reputation. I suggest the
>next course of action is for you to send me every instance of my code
>that you are using as a base for this claim so we can try to resolve
>this amicably. If this involves me restructuring a very small portion of
>my code for clarity I am reasonably happy to do so in the interest of
>getting this out of the way quickly.
>
>Tim

So, this now implies that only by Mr. Wille's involving the Microsoft operated web site, did Mr. Dawson feel that a reply was necessary. But there still is hope of resolving this matter without causing too much fallout even though the allegation of defamation is a somewhat serious matter. Now on to Mr. Wille's reply:

>The only reason why we did contact MS: we do not want anyone inadvertently
>(without knowing) incorporate GPL code in their applications. This is why
>we contacted MS, we know they are very sensitive about the GPL.
>
>Chris

This obviously makes sense, looking at Microsoft's licensing philosophy. In any case, no company would be happy to use misappropriated code in any way. But as Mr. Dawson pointed out, the stated misappropriation of code needs proof. It is no good practice at all to just darkly hint at things without offering concrete proof of wrong doing. So, Mr. Krueger looked at the possibilities for proving this in the most impartial manner and found that a very powerful tool for the detection of plagiarism exists in the form of the Longest Common Substring algorithm. This algorithm is in widespread use in academic circles to detect plagiarism in published works as well as in bioinformatics where it is used to identify similar genome sequences. It lends itself very well to adaption for comparing source codes. So Mr. Krueger went and implemented LCS to do as Mr. Dawson has asked. The results of a threeway comparison of the sourcesĀ“of Mr. Sheffield (referred to by Mr. Dawson as 'poor Eddie' above - more on this later), Mr. Dawson and Mr. Krueger are as follows, with additional comments by Mr. Krueger concerning some peculiarities:

>Hi Tim,
>
>first a comparison of source codes using a plagiarism detection tool (there
>are two forms designer implementations available with source code: one from
>Eddie Sheffield and ours - and ours was derived from Eddie's code (with
>permission as stated earlier); hosting refers to your code):
>
>***
>TEST 1 : sheffield --> sharpdevelop
>FileName src : SelectionServiceImpl.cs dst : SelectionService.cs
>source length : 2735 destination length : 3794
>  lcs match  : 1618/42%
>src file not found: no mach to ExtenderService.cs found
>src file not found: no mach to NameCreationService.cs found
>FileName src : DesignerTransactionImpl.cs dst : DefaultDesignerTransaction.cs
>source length : 1353 destination length : 751
>  lcs match  : 635/84%

>TEST 2 : sheffield --> hosting
>FileName src : SelectionServiceImpl.cs dst : SelectionService.cs
>source length : 2735 destination length : 3675
>  lcs match  : 1502/40%
>src file not found: no mach to ExtenderServices.cs found
>src file not found: no mach to NameCreationService.cs found
>FileName src : DesignerTransactionImpl.cs dst : MegaDesignerTransaction.cs
>source length : 1353 destination length : 516
>  lcs match  : 482/93%
>
>TEST 3 : sharpdevelop --> hosting
>FileName src : SelectionService.cs dst : SelectionService.cs
>source length : 3794 destination length : 3675
>  lcs match  : 2686/73%
>FileName src : ExtenderService.cs dst : ExtenderServices.cs
>source length : 1171 destination length : 707
>  lcs match  : 698/98%
>FileName src : NameCreationService.cs dst : NameCreationService.cs
>source length : 1402 destination length : 773
>  lcs match  : 602/77%
>FileName src : DefaultDesignerTransaction.cs dst : MegaDesignerTransaction.cs
>source length : 751 destination length : 516
>  lcs match  : 476/92%
>***
>
>The interesting point is that there is less similarity between Eddie's code
>and yours than between ours (based on Eddie's code) and yours.
>
>And here's the comparison done by Mike as he has developed our forms designer:
>
>*********
>
>- ExtenderService: Completely identical except for the declaration of
>Regions and the renaming of a variable from extenderProvidersArray to e;
>Agreement 98%
>
>- SelectionService: Agreement 73%
>   Remarkable items:
>   In the Method SetSelectedComponents a switch-case-statement is used,
>consisting of only one case and the default case; most people would use an
>if-statement.
>   A lower statistical agreement results from the fact that in this
>switch-case-statement code from methods in the SharpDevelop class has been
>inserted directly into the default case. The degree of agreement of this
>class is 85% when performing this replacement with the differences mainly
>resulting from comments.
>   In the SetSelectedComponents method, SelectionTypes.MouseDown is passed
>as an argument (in both classes), even though this is a bug and
>SelectionTypes.Replace ought to be passed. The bug will be fixed in the
>next #D version, it did not yet show up as this method is not currently used.
>
>In the original file the methods OnSelectionChanging and OnSelectionChanged
>were defined, in the hosting file they are always replaced by the code
>itself. The methods still are present but not used in any place.
>
>- MegaDesignerTransaction: Agreement 92%, the only difference is a renaming
>from FireTransactionClosing to OnTransactionClosing in the host which is
>called here.
>
>*********
>
>Given Mike's coding practices and other similarities (like an identical
>bug) it looks very much like our code served as a starting point.
>
>Chris

Interesting, isn't it? As I said, you be the judge...

To get our minds off this tedious matter for a short break, let us delve into the matter of 'poor Eddie'. This was a nice little side thread in this exchange and will hopefully add a little 'flesh' to the yarn. Mr. Wille wrote on this:

>One thing I absolutely do not understand in your email is why you refer to
>Eddie as "poor". Please explain, however, maybe the next paragraph is kind
>of connected.
>
>It is our policy to incorporate code into SharpDevelop only if we get
>explicit permission by the copyright holder. In that specific case, Eddie
>sent us a copyright assignment for his forms designer to be found under
>http://us.geocities.com/eddie_sheffield/index.html (which, btw, was already
>licensed under GPL). Eddie is a contributor to the SharpDevelop project and
>thus a member of our mailing list & other resources that are contributors-only.

Now the reply by Mr. Dawson:

>I referred to Eddie as "poor" because I was present on your forums when
>he first posted his designer example, which was when I started writing
>my own, using the knowledge I gained from reading his code. I never saw
>a reply in the thread from you thanking him for his efforts. In your own
>code, which I have read since, I noticed that it was basically his code
>with a few modifications, and yet the comments at the top of the source
>files said Mike was responsible.
>
>My code is my own, and written by me. However, on further inspection I
>have discovered a method in my implementation of ISelectionService which
>has the same structure as your implementation, and a block of code
>(commented out) which came straight from yours. I apologise for reacting
>hastily before, I had forgotten it was there. I assure you the rest of
>the class (and project) isn't derived in any way from SD code. Any
>similarities are coincidental.
>
>I am prepared to rewrite that whole method (SetSelectedComponents as I
>recall) from scratch. This will have the effect that no GPL'd code is
>present in the archive.
>
>Please let me know your thoughts on this.
>
>Regards,
>
>Tim

Now this matter is cleared up - Mr. Sheffield is 'poor' by way of being a SharpDevelop contributor. Mr. Dawson not acknowleding Mr. Sheffields work in his interesting article is no problem. After all, no one is obliged to cite references outside academia, or is that not so? And as a bonus, Mr. Dawson does mention some code 'came straight from yours' and that he will rewrite that - deny first, admit later.

Now that we have the entire story laid out before our eyes, the soda and the pop corn is at hand, we can look expectantly at how this will develop. And indeed, things do develop. For brevity's sake, I will quote a 'dialogue' in an email by Mr. Wille which was in reply to the LCS results:

> >Hi Chris,
 > >
 > >I acknowledge the similarity in the method in my ISelectionService
 > >implementation, and am taking steps to rewrite it. The
 > >DesignerTransaction implementation is a boilerplate subclass of the
 > >abstract DesignerTransaction class and there really isn't any other way
 > >to implement it. If I was to rewrite it it would simply come out the
 > >same.

Good that you acknowledge at least something - and we agree that similar
functionality can be implemented in similar code, some kind of software co-
evolution so to say. However in the case at hand this is about the strangest
case of co-evolution imaginable - the same names, the same coding
practices, even the same bugs.

 > >NameCreationService and ExtenderServices are the same way. There's so
 > >little code in these classes that as you let the class wizard generate
 > >the template to implement the interfaces and fill in the methods, it's
 > >pretty much unavoidable that they're going to be similar to yours.
 > >However, this is coincidental and there isn't much I can do about it. It
 > >isn't your code, it's mine - but it's very similar.

Similar is a very kind word. Which class wizard do you refer to? We use
#develop, do you?

 > >To tell the truth, I was expecting you to produce more evidence. Mike's
 > >original email stated that my code was "derived from SharpDevelop code"
 > >and that led me to believe that you thought most of it was.

LCS, or 'Longest Common Substring' is a proven method of plagiarism
detection and a level of 94% agreement is interesting indeed. Now what more
evidence could you wish for? Smoking guns, finger prints? And given the fact
that agreement between the #develop code and yours is significantly higher
than between either and Sheffield's code, makes derivation of your work from
Sheffields somewhat less than believable. His code, by the way is - as is
#develop - licensed under the GPL, should you have overlooked that fact, you
might still make amends for this by licensing your code under GPL as well.
No matter where you took your 'inspiration' from, GPL it is. To remind you,
the
GPL includes the following:

   2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

     a) You must cause the modified files to carry prominent notices
     stating that you changed the files and the date of any change.

     b) You must cause any work that you distribute or publish, that in
     whole or in part contains or is derived from the Program or any
     part thereof, to be licensed as a whole at no charge to all third
     parties under the terms of this License.

You now should know what to do.

 > >Please let me know if you'll be happy when I have rewritten my
 > >ISelectionService implementation. When it's done I will attach a
 > >revision note to the article to explain what I've done about it, and I
 > >expect you to send an email to whoever you contacted at MS to let them
 > >know they can reinstate the link.

Microsoft has received our analysis of the code in question and we feel
confident that they know how to react.

Anyways, a "code hero" that steals other programmer's code is not worthy of
being a code hero (and if it is only on one count, the one you admit).

Chris

The tone is slowly getting harsher, hopefully making this an interesting read for you who have borne with me up until now. And indeed, things *are* now looking like they might heat up further. First, another email by Mr. Dawson:

>Chris,
>
> > Good that you acknowledge at least something - and we agree that similar
> > functionality can be implemented in similar code, some kind of software
>co-
> > evolution so to say. However in the case at hand this is about the
>strangest
> > case of co-evolution imaginable - the same names, the same coding
> > practices, even the same bugs.
>
>It doesn't seem nearly as strange when you remember that we're implementing
>the same interfaces, to get the same behaviour. If we both managed to do
>things "the right way" then such a scenario isn't strange, and it doesn't
>mean I have stolen your code.
>
> > Similar is a very kind word. Which class wizard do you refer to? We use
> > #develop, do you?
>
>No, I don't. I've been trying it every six months or so since you first
>started working on it because I am also developing a .NET IDE as a hobby and
>I'm always curious about my competition. To be honest I found it buggy, but
>that's neither here nor there. I haven't used your class wizard, I use
>Visual Studio.
>
> > LCS, or 'Longest Common Substring' is a proven method of plagiarism
> > detection and a level of 94% agreement is interesting indeed. Now what
>more
> > evidence could you wish for? Smoking guns, finger prints? And given the
>fact
> > that agreement between the #develop code and yours is significantly higher
> > than between either and Sheffield's code, makes derivation of your work
>from
> > Sheffields somewhat less than believable. His code, by the way is - as is
> > #develop - licensed under the GPL, should you have overlooked that fact,
>you
> > might still make amends for this by licensing your code under GPL as well.
> > No matter where you took your 'inspiration' from, GPL it is.
>
>GPL doesn't cover inspiration, or learning from other people's code. It
>covers using the code in your own projects. I am aware of the instance where
>this happened (in ISelectionService) and have removed it. The remaining code
>isn't yours, or derived from it. I didn't say I derived my code from Eddie's
>either, I learned from it. Being derived from and learning from are two very
>different things. We have both taken Eddie's code and improved on it -
>yourselves literally, me by gaining the knowledge required by reading his
>code and then writing my own implementation. The fact that yours has
>followed similar trends in some classes, I don't find surprising at all.
>
>Frankly I am disgusted by the almost viral quality of the GPL and wouldn't
>touch it with a barge pole. Are you trying to say that because I started
>learning a lot of what I know from reading Eddie's code, that I must now put
>my own under the GPL too? Sorry, but knowing how to host windows forms
>designers is not an exclusive thing. As an aside, I had one working in my
>IDE before one even appeared in SharpDevelop.
>
> > You now should know what to do.
>
>Yes, I'm going to publish the revised version of my article with a note that
>the previous code contained a small portion of GPL'd code which shouldn't
>have been there. I will also apologise publicly for the mistake.
>
> > Microsoft has received our analysis of the code in question and we feel
> > confident that they know how to react.
> >
> > Anyways, a "code hero" that steals other programmer's code is not worthy
>of
> > being a code hero (and if it is only on one count, the one you admit).
>
>It was pointed out to me that you may be going after me with such enthusiasm
>because you wrote a book that apparently covers hosting winforms designers,
>and my article covers it too. So I made a mistake - I looked to your open
>source code for inspiration for one method implementation and didn't rewrite
>all of it. That mistake has been rectified and will be uploaded shortly. I
>put a great deal of effort in to my article, the source for it and all the
>other free stuff on my website that I'm giving to the community, and you
>have no right to dictate who is a code hero and who isn't.
>
>Tim Dawson

Now Mr. Dawson is fully entitled to his point of view, as is Mr. Wille. Nastiness now becomes abundant - which adds entertainment value but not much constructive argumentation to the matter at hand. Factually, we only learn that Mr. Dawson does not use SharpDevelop's class wizard, but rather VS.NET's - I personally do not own VS.NET, so I am not in a position to judge whether the respective wizards do generate identical code. There now is an entirely new quality to the dispute: 'argumtentum ad hominem', also known as personal attack. Not nice. I would much prefer that both sides tone down, but what can I - or you - do?

The latest we have regarding this matter is Mr. Wille's reply:

> > Microsoft has received our analysis of the code in question and we feel
> > confident that they know how to react.
> >
> > Anyways, a "code hero" that steals other programmer's code is not worthy of
> > being a code hero (and if it is only on one count, the one you admit).
>
>It was pointed out to me that you may be going after me with such enthusiasm
>because you wrote a book that apparently covers hosting winforms designers,
>and my article covers it too. So I made a mistake - I looked to your open
>source code for inspiration for one method implementation and didn't rewrite
>all of it. That mistake has been rectified and will be uploaded shortly. I
>put a great deal of effort in to my article, the source for it and all the
>other free stuff on my website that I'm giving to the community, and you
>have no right to dictate who is a code hero and who isn't.

I always like it when CC lists are expanded on an existing email thread.

Regarding your mentioning of the book, the chapter in question actually is
available as an entirely free PDF download (and btw, the book was published
by the now defunct Wrox, which means the book is virtually no longer
available; as a not so important side-note, the authors didn't get the
advances nor saw any royalties either - so please don't try to use the
argument of sales here).

I'm not dictating what anybody is or will be, I only questioned the
legality of what you provided to the community. And with respect to the
community, we will be providing the analysis we did on our Web site - for
public review by the community.

Chris

So now the code has been/will be modified, some more clarification has been given and hopefully we can all return to our daily lives. Who is right or wrong in this dispute, I leave for you to decide. You be the judge.

 

Copyright ©2001-2012 IC#Code. All rights reserved. Want to sponsor a feature / the project? Get in touch!