There are a lot of things that affect the success of your career, but few things affect it as much as credibility -- and there are few things that affect our credibility as much as our ability to be honest. Of course, there are other things that affect credibility -- skill and aptitude among them -- but our ability to be forthright ranks high.
Honesty in a workplace takes many forms, but it begins with being honest with ourselves. That is a surprisingly difficult thing to do in the workplace, because sometimes we know telling the truth may make things better for the company while making things worse for us individually.
I remember a time when I was quite young and I held my first non-burger-flipping job. There was an event that occurred that, frankly, I find quite embarrassing when I look back on it. The company I was working for had decided to create a business-casual dress standard and I was ready to get out my pitchfork and torch and join the rebellion when someone suggested, "If they want us to dress business casual they should pay us extra to buy the clothes."
I can't believe, now, that I took that comment seriously then. The truth of the matter was I was being paid to do a job, and it really is a privilege to have a job. It is the company's right to make changes they feel is in the best interest of the development of the company. But that isn't really even the main point.
The truth is, the passion behind the argument, "If they want us to dress business casual they should pay us extra" was never really about the money. I think those of us involved, with a little honesty, would have admitted that it was really about the fact that we liked wearing Levis and shorts and, odd as it seems now, we were irritated that they would require us to do otherwise. And I think this is often where the root of honesty in the workplace (and probably elsewhere) lies; it lies in our ability to objectively evaluate why we feel the way we do about things and to admit to ourselves that the truth may stand contrary to what we personally desire.
Thankfully, I wasn't foolish enough to actually voice my disgruntled concern to my manager. Had I done that, my credibility would have taken a serious hit and I suspect my future opportunities with the company (I eventually became a software developer for them) would have also been in jeopardy.
But since then I have noticed that decisions like these are constantly before us (often they are not as silly or as obvious as this example). My experience has taught me that the ability to see a situation from both points of view (mine and my employer's) and evaluate decisions honestly, pays big dividends with respect to credibility. When our employer sees that we are willing to accept a tough decision that may conflict with some personal desire or goal on the basis that it is better for the company, our credibility stock increases dramatically.
Of course there is a fine line between seeing things from the company's perspective and becoming a yes-man. Being a yes-man is as dishonest as hiding the truth for our own benefit - in fact, it is often exactly the same thing with different consequences. Saying yes, when you know the answer should be no, just because you know it will please your boss is still lying at the company's expense for your own benefit. This leads to another important point with regard to credibility.
In The Clean Coder, Bob Martin states, "Slaves are not allowed to say no. Laborers may be hesitant to say no. But professionals are expected to say no. Indeed, good managers crave someone who has the guts to say no. It’s the only way you can really get anything done." It is true that a good manager will respect you when you stand on principle and help him/her to see things more clearly. As developers, this often becomes an issue when we are asked to get something done in a time frame that we know is unrealistic, but it is also true with respect to what we develop, not just how long we take.
Of course, being honest with ourselves is also at the root of being able to be honest with when we say "no". We need to evaluate if we are saying "no" for personal benefit or because it is truly what is right professionally.
As we learn to recognize the true reasons behind our thoughts and emotions it will help us to be more honest with ourselves. When we are more honest with ourselves we can be more honest with our employer. Over time, our employers will recognize that, above all, we are trustworthy. They will realize that, when they come to us with questions or suggestions, we will understand where they are coming from and they will know that they won't be surprised down the road because we did what they said when we should have pushed back. In the end, this is the credibility we need to be successful.