One of the virtues of a good programmer (as observed by Larry Wall) is laziness. Don’t write code that you don’t have to! In this spirit, the File Exchange is a boon to the lazy. Whenever you sit down to code, listen to the voice that says “someone must have written this already.” Because it’s probably good advice. Sometimes you’ll find exactly what you need on the File Exchange. Done! Other times you might find something that’s close to the right thing, but not quite. In those cases, consider taking what you find and adapting it to your needs… and then consider resubmitting your adapted code to the File Exchange.
It may feel like cheating at first, but the File Exchange has a mechanism to let you acknowledge the person (or people) that you borrowed code from.
When you submit a file to the File Exchange, you come across a section called “License and Acknowledgments.” This gives you a place to mention the other files that helped you create yours, either because you borrowed code from them or because you just want to publicly acknowledge your appreciation of their influence.
Here’s an example. When Douglas Schwarz wrote his highly regarded Fast and Robust Curve Intersections, he made sure to acknowledge the pre-existing file Curve Intersect 2 by Sebastian Hölz. We’ve had this feature in place for many years, and I decided it was time to take a look at the patterns of attribution that we see.
Of the more than 17,000 files on the File Exchange, there are 2910 separate acknowledgments like the one mentioned above. In one way or another, 2050 files acknowledge their debt to a total of 1870 inspiring files. If you think of each one of these acknowledgments as a pointer from the inspiring file to the inspired file, then the whole site can be thought of as a directed graph. Consider the example above. The inspiration doesn’t stop with Douglas Schwarz’s file. That one went on to inspire others. Here’s a look at the acknowledgment tree.
In this picture, each box is a different submission labeled with the author’s last name. Isn’t that lovely? It’s exciting to see the “footprints” of good ideas as they move through the site.
These patterns of acknowledgment can be extensive and visually striking. Some of the trees are deep and some are wide. Here’s a wide one that starts with Oliver Woodford’s exportfig.
With our link data, we can figure out which is the single most influential file in terms of link count. And the answer is… one of the oldest files on the site from Christophe Couvreur. Take a look at how wide this one is.
The largest fully-connected subnet of files has over 200 files in it, all of them connected to each other through a series of links, each link a thoughtful token of respect.
If we go from a file-centric to an author-centric view, we can determine the most influential authors. Who has the most acknowledgments considering all the files they submitted (we ignore self-linking for this analysis). In other words, which authors are the most influential?
- John D’Errico
- Christophe COUVREUR
- Yair Altman
- Scott Hirsch
- Yi Cao
- Malcolm Lidierth
- Robert Bemis
- Douglas Schwarz
- Dirk-Jan Kroon
These people are heroes of the MATLAB Community. They have freely given, and we have all benefited.
I want to see your name on this list!
Let’s say you agree. Let’s say you’re ready to let people start building on your code. How do you start? Paradoxically, a good way to start is by borrowing someone else’s code. You’ll learn good coding practices by borrowing from the best, and you’re likelier to build something worth borrowing by standing on the shoulders of others. You’ll also be bound more deeply into the community. And soon you’ll see how satisfying it is to have someone use your code as a springboard for something wonderful that never would have occurred to you. So give by taking. You’ll be surprised how far it gets you.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.