Modern science, and indeed academic endeavors in general, are based on the idea that knowledge should be shared. Almost everything in the academic world is designed to encourage sharing; everything good comes from making your discoveries public and no benefits arise from keeping them to yourself. As far as I can tell this is simply the best way to expand what we know, since discoveries are made public everyone has the opportunity to evaluate them and develop further ideas as extensions to them if they stand up to scrutiny. In fact it is hard to even imagine a scientist hoarding their knowledge without some extraordinary circumstances being involved.
But not all knowledge is made public in this way, there is one area of study that is an exception to this general way of doing things: software. Programmers who develop software are making new “discoveries” (in a very loose sense of the word, in the same way we might say that a mathematician makes “discoveries”, even though there is no mathematical world to make discoveries about), they discover ways to make the computer do certain tasks. But, unlike in every other intellectual field, programmers tend not to share their knowledge. Usually they are making their discoveries when in the employ of the some company, and the company feels that it should keep these discoveries secret for their competitive advantage. And for them this seems like simply the way things are done. But, from an outside perspective, the whole thing seems absurd.
Consider what other fields would be like if the people involved hoarded their knowledge instead of sharing it. If doctors and biologists hoarded their knowledge then each hospital you visited would practice medicine in a different way, and would know how to treat different diseases. Doctors that moved from one hospital to another would have to learn how to do medicine all over again. This would have the overall effect of making hospitals worse in general. With medical discoveries staying with the walls of the hospitals that they originated in, in order to maintain their competitive advantage over other hospitals, we would still be stuck with 19th century medicine. And it would be similarly absurd if engineers had to purchase science like they purchase software. (Is gravity 4.5 compatible with aerodynamics CS 2?) Although the people managing scientists might be much richer, the world as a whole would be worse off.
Obviously I can’t pretend that hoarding knowledge is completely without its benefits. The ability to maintain an unnatural monopoly on such discoveries does allow companies to make more money than they would be able to otherwise. And some might even argue that the potential profits drive discoveries in certain uninteresting areas that few would be motivated to explore otherwise (involving boring software). But these benefits hardly seem to outweigh the harm done by the artificial barriers raised to sharing knowledge. Simply considering what other fields would be like were they to engage in similar knowledge hoarding should make us wonder what software would be like were its knowledge to be shared freely. Also, we have to consider that knowledge flourishes best when it is pursued for its own sake, and not because of any immediate applications (since often avenues of research that are at first thought to have no practical importance turn out to have a number of useful applications). Separating software discoveries from corporate profits is required for them to be pursued for their own sake as knowledge, and thus for significant headway to really be made.
Now some involved with software may assume at this point that I am ignorant of the free software movement, where programmers make their discoveries public under certain restrictions that require those who use them to make their discoveries public as well (the GPL). This is reminiscent of the way ethics might emerge in a hypothetical world full of selfish people. Obviously two people who act ethically when dealing with each other will both be better off than two people who interact selfishly. But if someone acting ethically interacts with someone acting selfishly they will end up losing out and it will be selfish person that comes out ahead. This might seem to prevent ethical people from ever emerging, since they would always lose out to the existing selfish people. However, all that is needed is some way for the ethical people to identify each other, and then they can act ethically with each other and selfishly with outsiders, resulting in the community of ethical people thriving and eventually dominating society. And some may see the free software community in a similar light, as a community that agrees to act ethically with each other (by sharing their knowledge), but unethically with those who refuse to share.
The problem with this is that, while sharing knowledge is the ethical thing to do (since it is what is in the best interests of the community) the GPL is not the best way to do it. What is missing is the right motivations. In the case of ethics the people who joined the ethical community benefited. But it is not clear that by joining the community of knowledge sharers the corporations will benefit. True, they will gain the advantage of being able to draw upon the knowledge shared in that community, but they will no longer be able to profit from this knowledge, since the GPL essentially prevents their usual business model from working. Furthermore, in the case of the ethical and selfish people the ethical people were put at a disadvantage when they dealt ethically with selfish people. But there is no harm done to the community of sharers when someone who isn’t sharing uses their knowledge. If everyone was free to use their work without sharing in return there would be only minor differences, the community of sharers wouldn’t shrink, at least not by much. And by allowing everyone else to use their knowledge it would improve the rest of the software world. Thus it would seem like the really ethical thing to do in this situation would be allow everyone to use your knowledge, regardless of what they plan to do with it, which is essentially how the academic world works. Of course there is a software license that works in this way (BSD), it’s just much less popular.
However, the real world may seem to contradict my claims. After all there is plenty of free software, and yet little of it seems definitively better than software developed without knowledge being shared. For example, while Linux may be considered technically superior to OS X or Windows it doesn’t seem to be a superior operating system, given that we judge the merits of an operating system by how much they appeals to the users (who are the judges that really matter). Now it might be argued that there are other factors that interfere with people adopting Linux, but it is somewhat hard to believe. If one product is genuinely superior to another in a way that actually matters to people (meaning that they will prefer the one to the other given an exposure to both) then it will tend to spread. Firefox is great example of this, as before IE caught up with tabs it had noticeable usability advantages that made people want to switch to it.
The problem then is primarily one of attitude, and I’m not sure exactly how to fix that, although it is possible that it will simply work itself out in time. One possible way to overcome the problem is to focus on programming and sharing done in a more abstract language, one so abstract that it can’t even compile to an actually functioning program by itself. The idea is that this abstract language forces work done in it to be understandable and modular. Of course to actually convert it to a working program additional files must be added, in order to clarify it sufficiently for a computer to work with. But the idea is that by understanding the abstract description we can work primarily with it, and using it as a map to implementation details when needed. There might be other possible solutions as well, although none pop into mind at the moment, but I am sure that there is some way to solve the problem of hoarding by obscurity, because certainly programming is easier than theoretical physics, and we have no problem in sharing our knowledge about physics.
 Naturally in such a world programmers wouldn’t be hired by companies (or at least it would be about as rare as a physicist hired to do physics), but this doesn’t mean that programmers would be left out on the streets. We need software as a society, and so they would probably end up either as academics or employed by the government as public servants.