We all know how fantastic the open-source movement is. How wonderful it is with all these people that distribute their code, schematics, data, ideas etc. for free and in such a spirit of openness. We gain so much from it and it is all really great.
But seen from the contributor's point of view, one could ask the questions: why share your hard-earned knowledge? What are the benefits and why spend a lot of time helping unknown people - often without even thanks in return? Why give away code that you care about and that have taken lots of effort and hours to write - for free? Is it for personal fame? Is it the communal spirit or some political beliefs? Or the lack of interested commercial companies?
My personal and perhaps slightly provocative answer is that I share because of egoism/self-interest. I found that by making something public, I force myself to write more reusable and understandable code. Publicising means I will proof-read, add comments and help-files and perhaps cross-platform support. Sharing also makes me reluctant to drastic change and help fixate things like interface, protocol and functionality. So after uploading code, I feel responsible to maintain it for the future throughout system and program upgrades - whether other people depend on it or not. It is the knowledge that someone _might be using it that is enough to put in that little extra effort and spend a few additional hours.
So for me as an independent software developer/artist, open-source is mainly a vehicle for caring about my own work. And it is the simple act of making it open and public that is so extremely helpful for me.
Of course, this is not the only reason. It is a great pleasure to see code I have written is helpful in other people's work, get feedback from users and see my ideas being developed a lot further by other artists. I also enjoy helping out where ever I can, passing on knowledge from people I, in turn, learned from. And being a frequent contributor in various communities do generate paid work in the form of workshops, concerts, programming jobs and technical support.
But again - the main reason I share is a selfish, practical and simple one: I write better code because I distribute it.