I like to encourage developers and engineers to open source their robotics projects when possible. Obviously the nature of intellectual property and ownership does not always permit this, and there is still a great amount of proprietary software that many businesses rely on which cannot be open sourced.
However, all is not lost. There is many alternatives that make it possible to leverage the advantages of open source software while avoiding releasing proprietary code. As usual in development, abstraction is the key. Instead of releasing the entire sum of a project, try modularizing the codebase into one or more abstract library that can be released. The added advantage here is that the process of modularizing your codebase will significantly improve the readability and maintainability of your code.
There are a significant number of benefits to open sourcing a useful package or library. Aside from the possibility of allowing a community of other developers to double check your work and possibly improve it, an open source project can become a significant way for a single developer or a company to establish and maintain reputability.