This is something I question alot of the time and try to give general reference to code rather than a site or screenshot. I feel like if some was to stumble upon there site on a message forum as such they may be turned off by the developer / designer and their professionalism. I know this is a general design related question but I am curious to get the thoughts of other desinger/developers.
My thoughts on this situation are, while it is nice to have a community to turn to when in doubt or need, the last thing in the world I would want a client (past or present) to see there screenshot of their site being publicized on a forum for "help". Generally in my experience this could and would be looked at as incompetence. Again, these are my opinions and I would love to here input from the DOCTYPE community.
You would be incompetent if you linked to a client site on a public (and well indexed) site such as this, because in all probability a search for their name will show this site up higher than their actual site.
To ask a question on here or similar sites, you should create a test case of the problem, stage it on a development server, remove any identifying graphics or text and then link to it.
However, that requires effort, and would probably lead to a solution whilst creating the test case, so the lazy route is to post the development site complete with client names, and as you say, what that does is show up weaknesses which you may then have to explain to the client.
I think it's good that bad practice highlights the weaknesses, that way, weak web 'designers' learn by hard lessons and clients learn what value they get for their money.
I agree with both of the above. Linking to the actual site is unprofessional. A test case is the best way to go about it, or a thorough explanation of where the problem is happening and how is a better alternative than linking to a client's site.
We're leaving out an important person here; the client. I agree totally that it's very risky business to link to a dev environment if you haven't thought it about the consequences and got the OK from your client. But if your client thinks it's okay to invite community to the development of their new site it could be a thing to consider. I generally think we spend to much time by our own solving problems by our own and keeping coding-secrets from our fellow colleagues, thus hampering the evolution of web development (in a larger perspective). Organize - evolve.