An objection I’ve had to many programming books and web sites is that they don’t make sample code available under a free software license. This is within the rights of the author, of course, but it seems counter to the spirit of teaching and sharing knowledge to restrict the use of example code.
A writer of instructional material may be doing so to earn some money, but I hope he or she is also motivated by the desire to help others. I think the best authors and teachers are motivated strongly by this desire. And if this is the case, I think it reasonably follows that the author of a programming work should want their students to be able to freely use their source code in the students’ own creations.
I was happy to exchange words recently with an author who was open and responsive to making his sample code available under a free license. With tomorrow being Software Freedom Day, it seemed like a good time to write about our email conversation and point you to the free(!) code. I hope this also shows the value in politely asking for free software in some situations.
First, something I had previously written about my sample code concerns–but hadn’t gotten around to publishing–sets up the story:
Unfree code from Bruce Eckel’s “Thinking in Java”
One example of limiting reuse is Bruce Eckel’s Thinking in Java. I didn’t originally learn the Java language from Eckel’s book, but I wish I had. After discovering earlier free (as in free beer) online editions, I found them to be well written and helpful when looking up various concepts. I was appreciative that Bruce offered the entire book free online, and he was open to and enlightened about this approach.
I noticed the latest edition of TIJ (the 4th) only has the first seven chapters available online, but that’s ok with me. I’m happy to pay $40 for a thousand pages of good instruction. (And in the past year I did actually buy the book, in the form of having my employer pay for it.) The problem for me is in the sample code copyright. It appears to allow inclusion of the code in personal or commercial software programs in binary form only, and in source form only for educational use and without modification.
Again, entirely within the rights of the author. This is not meant to run down Bruce, because I love the book and think he has been generous in sharing previous versions of it, but restricted sample code is only of limited usefulness to me. If I’m learning programming from a book, I’ll very often want to take chunks of source code to incorporate in to my own programs (with proper attribution, of course!), and I want to make those programs free as in freedom to be used by others. Without that freedom, I’ll be able to learn from the book, but it won’t be as effective in letting me leverage and share my newfound knowledge.
Initially unfree code from Edwin Wise’s “Hands-On AI with Java”
Sample code from another book I started looking at recently was more ambiguous in the license it conferred. The source code from Edwin Wise’s Hands-On AI with Java had no license and just a simple copyright notice, which I guess is unambiguous in not granting any rights to reuse and distribute the code.
However, this seemed more hopeful than the clearly spelled-out policy in Mr. Eckel’s book, so I emailed Mr. Wise, wondering if he freely licensed the source code. I mentioned specifically I was interested in a free license like the GNU GPL.
Quickly becoming liberated…
Edwin wrote back a couple of days later, agreeing that not having attached any particular license to the code, it just defaulted to the generic copyright. He was curious what I planned to use it for, noting that he had no problem with the code being used as part of a product, but that he would take issue with it appearing in articles or books without appropriate credit. This is perfectly reasonable. I’m looking forward to a future where all published works may be freely copied, but I believe proper attribution should always be our primary moral responsibility with respect to these works.
He was open to researching licenses, and said he would open the code up for free use. His only caveat was that the code wasn’t production-quality so that he hoped I didn’t do anything critical with it. I wrote back at length to say thanks for his openness and willingness to share the code, and recommended using the GPL v3 license (with the “or later” clause), mentioning that the standard format would clearly show his copyright at the top of the source files along with the disclamation of liability for others’ use of it.
I suggested including an official statement on the AIJ web site along with a LICENSE file in the download zip, thinking that he would be too busy for more extensive updates, but I was delighted with his quick response that it seemed best to embed the GPL notice in each source file, which he had already done and made available on the book’s web page.
Check it out!
So, check out the free source code at the Hands-On Artificial Intelligence web site, where Edwin wrote: “Now released under the GNU Public License v3, because teaching material deserves to be used as widely as possible.”
Right on.
And now we have a nice collection of code demonstrating AI methods and techniques that we can freely use and share. If you like the source code, why not buy the book to help you get the most out of it and support an author who supports free software.
Topics include: Control Systems, Scripted Behavior, Discrete Searching, Searching State Space, Genetic Algorithms, Thinking Logically, and Supervised and Unsupervised Neural Networks.
I thought this was very generous from someone who categorized himself as not part of the FOSS movement, although a sympathizer. Where I had written: “I’m often disappointed by learning materials that are overly restrictive in the license on sample code. That’s within the rights of the author, of course, but it seems counter to the spirit of teaching and sharing knowledge.”, Edwin replied: “I can certainly agree with that — shared knowledge is far more useful to humanity than knowledge horded away. While there is always the fight to pay the bills, the state of software patents and IP protection has devolved to the level that can only be described as ‘retarded’.”
Thanks again, Mr. Wise, and a happy Software Freedom Day 2007 to all.
Spread the word! Vote for this post at Free Software Daily and digg it at digg.
P.S.
I wanted to mention an “open source” project that Edwin is involved in as part of the League of Technical Voters and their WAAA/Federal Budget project: The Transparent Federal Budget. This will use community-driven data with the goal of making “the political process more transparent, in order to increase public visibility and accountability of government.” Which seems very much in the spirit of a free society and peer production, and I wish them luck with this, even if my pessimistic side suspects our corrupt politicians might simply use projects like this as a way of keeping score on their ill-gotten pork successes, while an apathetic citizenry ignores the information. Let’s not be that citizenry.


