Above all else a commercial software development environment (like almost all of life's endeavors) is about relationships with other people. You have a relationship with the folks who will use your software. You have a relationship with your bosses. You have a relationship with your employer and its investors. You have relationships with your coworkers.
How does a person stay balanced and serene amongst all of these competing interests? I like to follow these three principles.
The Zero Point Protocol
Relationships can end unexpectedly at any time, no fault of yours or even of your own doing. Hence in order to prevent usury one must always maintain a fair and equitable social balance in all relationships.
Sure progress is made by give and take: you give your work in return for a salary, or you give your mentoring in return for, say, an inside position or a future referral. The Zero Point Protocol assumes the stance that all of your work relationships may suddenly end: how would you feel? If you would feel angry and cheated then this indicates you were probably giving too much to begin with. Always keep your relationships balanced and grounded at zero.
The Principle of Equivalent Commitment
Many times relationships feel out of balance since you are investing more of your future into a process or products than the recipient is investing back toward your future. Keep commitments honest and balanced by gently suggesting ways that relationships might be strengthened. Avoid sacrificing your future for the sole benefit of others; make sure they promote your future as much as you promote theirs.
The Principle of Perceived Value
Always assess your fellow employees to gauge how much potential they have for appreciating you and what you have to offer. If you sense that a person legitimately lacks the capacity to even perceive what you can offer, then you shouldn't waste your time with them.
These are intended only as principles for your use during employment; family and friends behave quite differently and ascribe to different values. Keeping these three Principles in mind at work however will keep you both productive and safely balanced.