I am wondering if there's any harm in giving out my adsense pub id. I have a programmer who is doing a job for me and has requested my pub id for the project. Is there any harm in it?
There's always a possibility that it could be dangerous. Someone could put your pub-ID onto their Adsense code and click bomb ads, which may result in a ban. However, generally, I think it's pretty much safe. Google could probably track that if it happens, so don't worry too much about that.
Keep in mind - someone using your publisher ID on a website that violates Google's TOS would get your account banned. Even so, if you have hired the programmer and he merely requires the code for the project at hand, I don't see any risk in handing it over. No, he cannot touch your earnings through your publisher ID if that is one of your concerns.
If someone really wants it they can get it, obviously through your website. But I would not suggest it unless it's on something like a rev share deal.