This is clearly bothering you, so approach him and discuss the issue in private. Arrange a one on one, and get right to the point:
Hi boss, lately you've been making a bunch of comments regarding my abilities as a programmer. I was wondering if this is because you have concerns regarding my performance, or the quality of my deliverables.
His answer will guide the conversation going forward. If he says he was purely joking, however, ask him to stop:
I understand that you meant it all as a joke, but could I please kindly ask you to not joke like this around customers? I feel that it's impacting their perception of me negatively. I'm supposed to be the subject matter expect, and them doubting my skills or abilities impact the quality of the support I am able to deliver to them.
That little twist at the end makes it about the company, and the customer, rather than your own feelings, and you avoid coming across as "difficult". If your boss is mature, he will take your concerns to heart, and stop. If he isn't (which is probably why he's making these incredibly tasteless jokes to begin with), then you may need to revisit this conversation ... Remember that he can only brush you off if you let him.
Now as far as him doing this to the rest of the team is concerned, don't conflate your own situation with theirs unless they elect you as their spokesman.